From bd9f337a5b908ac3b4ceb549e9c1befc9cd063bc Mon Sep 17 00:00:00 2001 From: OneOfEleven Date: Thu, 5 Oct 2023 15:26:08 +0100 Subject: [PATCH] Make all warnings vanish over to bricky's house ! --- Makefile | 1 + am_fix.c | 2 +- app/app.c | 9 +++++++-- app/dtmf.c | 5 +++++ app/menu.c | 19 +++++++++++++++++-- app/scanner.c | 10 +++++----- app/uart.c | 2 +- audio.c | 5 +++++ driver/adc.c | 4 ++-- driver/aes.c | 2 ++ driver/keyboard.c | 4 ++-- driver/spi.c | 4 ++-- firmware.bin | Bin 53888 -> 53888 bytes firmware.packed.bin | Bin 53906 -> 53906 bytes misc.h | 22 +++++++++------------- radio.c | 24 +++++++++++++++++------- settings.c | 20 +++++++++----------- ui/main.c | 36 ++++++++++++++++++++++++++---------- ui/menu.c | 5 +++++ 19 files changed, 116 insertions(+), 58 deletions(-) diff --git a/Makefile b/Makefile index 52f4113..3be841a 100644 --- a/Makefile +++ b/Makefile @@ -200,6 +200,7 @@ endif # May cause unhelpful build failures #CFLAGS += -Wpadded +CFLAGS += -Wextra CFLAGS += -DPRINTF_INCLUDE_CONFIG_H CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\" diff --git a/am_fix.c b/am_fix.c index 51c11ae..09d67e9 100644 --- a/am_fix.c +++ b/am_fix.c @@ -475,7 +475,7 @@ void AM_fix_print_data(const int vfo, char *s) { - if (s != NULL && vfo >= 0 && vfo < ARRAY_SIZE(gain_table_index)) + if (s != NULL && vfo >= 0 && vfo < (int)ARRAY_SIZE(gain_table_index)) { const unsigned int index = gain_table_index[vfo]; // sprintf(s, "%2u.%u %4ddB %3u", index, ARRAY_SIZE(gain_table) - 1, gain_table[index].gain_dB, prev_rssi[vfo]); diff --git a/app/app.c b/app/app.c index 025544d..b4786e4 100644 --- a/app/app.c +++ b/app/app.c @@ -647,6 +647,9 @@ static void MR_NextChannel(void) if (enabled) { + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (gCurrentScanList) { case SCAN_NEXT_CHAN_SCANLIST1: @@ -680,7 +683,7 @@ static void MR_NextChannel(void) // { // chan = (gEeprom.RX_VFO + 1) & 1u; // chan = gEeprom.ScreenChannel[chan]; -// if (IS_MR_CHANNEL(chan)) +// if (chan <= MR_CHANNEL_LAST) // { // gCurrentScanList = SCAN_NEXT_CHAN_DUAL_WATCH; // gNextMrChannel = chan; @@ -695,6 +698,8 @@ static void MR_NextChannel(void) chan = 0xff; break; } + + #pragma GCC diagnostic pop } if (!enabled || chan == 0xff) @@ -2042,7 +2047,7 @@ void CHANNEL_Next(bool bFlag, int8_t Direction) gCurrentScanList = SCAN_NEXT_CHAN_SCANLIST1; gScanState = Direction; - if (IS_MR_CHANNEL(gNextMrChannel)) + if (gNextMrChannel <= MR_CHANNEL_LAST) { if (bFlag) gRestoreMrChannel = gNextMrChannel; diff --git a/app/dtmf.c b/app/dtmf.c index ffb9241..0f96941 100644 --- a/app/dtmf.c +++ b/app/dtmf.c @@ -331,6 +331,9 @@ void DTMF_HandleRequest(void) gUpdateDisplay = true; + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (gEeprom.DTMF_DECODE_RESPONSE) { case DTMF_DEC_RESPONSE_BOTH: @@ -348,6 +351,8 @@ void DTMF_HandleRequest(void) break; } + #pragma GCC diagnostic pop + if (gDTMF_IsGroupCall) gDTMF_ReplyState = DTMF_REPLY_NONE; } diff --git a/app/menu.c b/app/menu.c index 45ec8a5..018795b 100644 --- a/app/menu.c +++ b/app/menu.c @@ -408,6 +408,9 @@ void MENU_AcceptSetting(void) gRequestSaveChannel = 1; return; + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + case MENU_T_CTCS: pConfig = &gTxVfo->freq_config_TX; case MENU_R_CTCS: @@ -436,6 +439,8 @@ void MENU_AcceptSetting(void) gRequestSaveChannel = 1; return; + #pragma GCC diagnostic pop + case MENU_SFT_D: gTxVfo->TX_OFFSET_FREQUENCY_DIRECTION = gSubMenuSelection; gRequestSaveChannel = 1; @@ -1170,7 +1175,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) if (edit_index < 10) { - if (Key >= KEY_0 && Key <= KEY_9) + if (/* Key >= KEY_0 && */ Key <= KEY_9) { edit[edit_index] = '0' + Key - KEY_0; @@ -1193,6 +1198,9 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) if (!gIsInSubMenu) { + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (gInputBoxIndex) { case 2: @@ -1224,6 +1232,8 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) break; } + #pragma GCC diagnostic pop + gInputBoxIndex = 0; gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; @@ -1269,7 +1279,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) Value = ((gInputBox[0] * 100) + (gInputBox[1] * 10) + gInputBox[2]) - 1; - if (IS_MR_CHANNEL(Value)) + if (Value <= MR_CHANNEL_LAST) { #ifdef ENABLE_VOICE gAnotherVoiceID = (VOICE_ID_t)Key; @@ -1661,6 +1671,9 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction) VFO = 0; + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (gMenuCursor) { case MENU_DEL_CH: @@ -1681,6 +1694,8 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction) return; } + #pragma GCC diagnostic pop + Channel = RADIO_FindNextChannel(gSubMenuSelection + Direction, Direction, bCheckScanList, VFO); if (Channel != 0xFF) gSubMenuSelection = Channel; diff --git a/app/scanner.c b/app/scanner.c index b203ad4..b74fc27 100644 --- a/app/scanner.c +++ b/app/scanner.c @@ -67,7 +67,7 @@ static void SCANNER_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) gInputBoxIndex = 0; Channel = ((gInputBox[0] * 100) + (gInputBox[1] * 10) + gInputBox[2]) - 1; - if (IS_MR_CHANNEL(Channel)) + if (Channel <= MR_CHANNEL_LAST) { #ifdef ENABLE_VOICE gAnotherVoiceID = (VOICE_ID_t)Key; @@ -193,7 +193,7 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld) } } - if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) + if (gTxVfo->CHANNEL_SAVE <= MR_CHANNEL_LAST) { gScannerEditState = 1; gScanChannel = gTxVfo->CHANNEL_SAVE; @@ -247,7 +247,7 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld) gTxVfo->freq_config_TX.Code = gScanCssResultCode; } - if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) + if (gTxVfo->CHANNEL_SAVE <= MR_CHANNEL_LAST) { Channel = gScanChannel; gEeprom.MrChannel[gEeprom.TX_VFO] = Channel; @@ -428,7 +428,7 @@ void SCANNER_Stop(void) if (!bScanKeepFrequency) { - if (IS_MR_CHANNEL(gNextMrChannel)) + if (gNextMrChannel <= MR_CHANNEL_LAST) { gEeprom.MrChannel[gEeprom.RX_VFO] = gRestoreMrChannel; gEeprom.ScreenChannel[gEeprom.RX_VFO] = Previous; @@ -446,7 +446,7 @@ void SCANNER_Stop(void) return; } - if (!IS_MR_CHANNEL(gRxVfo->CHANNEL_SAVE)) + if (gRxVfo->CHANNEL_SAVE > MR_CHANNEL_LAST) { RADIO_ApplyOffset(gRxVfo); RADIO_ConfigureSquelchAndOutputPower(gRxVfo); diff --git a/app/uart.c b/app/uart.c index c109419..f54e722 100644 --- a/app/uart.c +++ b/app/uart.c @@ -450,7 +450,7 @@ bool UART_IsCommandAvailable(void) Index = DMA_INDEX(gUART_WriteIndex, 2); Size = (UART_DMA_Buffer[DMA_INDEX(Index, 1)] << 8) | UART_DMA_Buffer[Index]; - if ((Size + 8) > sizeof(UART_DMA_Buffer)) + if ((Size + 8u) > sizeof(UART_DMA_Buffer)) { gUART_WriteIndex = DmaLength; return false; diff --git a/audio.c b/audio.c index 671d386..b46fd44 100644 --- a/audio.c +++ b/audio.c @@ -142,6 +142,9 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) SYSTEM_DelayMs(60); + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (Beep) { case BEEP_880HZ_60MS_TRIPLE_BEEP: @@ -181,6 +184,8 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) break; } + #pragma GCC diagnostic pop + SYSTEM_DelayMs(Duration); BK4819_EnterTxMute(); SYSTEM_DelayMs(20); diff --git a/driver/adc.c b/driver/adc.c index 6f0214b..bde01f0 100644 --- a/driver/adc.c +++ b/driver/adc.c @@ -134,9 +134,9 @@ void ADC_Configure(ADC_Config_t *pAdc) ; if (SARADC_IE == 0) { - NVIC_DisableIRQ(DP32_SARADC_IRQn); + NVIC_DisableIRQ((IRQn_Type)DP32_SARADC_IRQn); } else { - NVIC_EnableIRQ(DP32_SARADC_IRQn); + NVIC_EnableIRQ((IRQn_Type)DP32_SARADC_IRQn); } } diff --git a/driver/aes.c b/driver/aes.c index 17a3990..6a8b5c0 100644 --- a/driver/aes.c +++ b/driver/aes.c @@ -24,6 +24,8 @@ static void AES_Setup_ENC_CBC(bool IsDecrypt, const void *pKey, const void *pIv) const uint32_t *pK = (const uint32_t *)pKey; const uint32_t *pI = (const uint32_t *)pIv; + (void)IsDecrypt; // unused + AES_CR = (AES_CR & ~AES_CR_EN_MASK) | AES_CR_EN_BITS_DISABLE; AES_CR = AES_CR_CHMOD_BITS_CBC; AES_KEYR3 = pK[0]; diff --git a/driver/keyboard.c b/driver/keyboard.c index e490a13..91285df 100644 --- a/driver/keyboard.c +++ b/driver/keyboard.c @@ -103,7 +103,7 @@ KEY_Code_t KEYBOARD_Poll(void) // ***************** - for (int j = 0; j < ARRAY_SIZE(keyboard); j++) + for (unsigned int j = 0; j < ARRAY_SIZE(keyboard); j++) { //Set all high GPIOA->DATA |= 1u << GPIOA_PIN_KEYBOARD_4 | @@ -118,7 +118,7 @@ KEY_Code_t KEYBOARD_Poll(void) // Read all 4 GPIO pins at once uint16_t reg = GPIOA->DATA; - for (int i = 0; i < ARRAY_SIZE(keyboard[j].pins); i++) + for (unsigned int i = 0; i < ARRAY_SIZE(keyboard[j].pins); i++) { uint16_t mask = 1u << keyboard[j].pins[i].pin; if (!(reg & mask)) diff --git a/driver/spi.c b/driver/spi.c index 9fb5e02..4a1a279 100644 --- a/driver/spi.c +++ b/driver/spi.c @@ -93,9 +93,9 @@ void SPI_Configure(volatile SPI_Port_t *pPort, SPI_Config_t *pConfig) if (pPort->IE) { if (pPort == SPI0) { - NVIC_EnableIRQ(DP32_SPI0_IRQn); + NVIC_EnableIRQ((IRQn_Type)DP32_SPI0_IRQn); } else if (pPort == SPI1) { - NVIC_EnableIRQ(DP32_SPI1_IRQn); + NVIC_EnableIRQ((IRQn_Type)DP32_SPI1_IRQn); } } } diff --git a/firmware.bin b/firmware.bin index 1c41ed71bafb87c6582928a0bf533aaf43b99353..021cb5e75cdecebbb8396298f6a14c5a919459f1 100644 GIT binary patch delta 3344 zcmYjTdw3Mp6+dTYp9#S{8nds2-I**TSD?{*^^ZB<`Q7_F z_dM>s=T65#w&Nf>aw>C9*NCn~5=-TXmC1w8zOk+mHlc0{2@3s#<-Mmpr z!kIiSCCRrMlRcqsy-U+;hYLR@MYm?6nk>C_gLi}J`RZSpzVY6l4WzmHYwzA{?0MTe zC!6WHXgcd(NZ1OAwpIA*Ot6Cnrryjb$?5qOQ?6GphJTNi3vD<;-?isa`;4WpDBZqBf@_Mx^~_N&Hjv z6qWBq_fh#y^jB2A6+J-Z8_`@UPeePZ{9P30Sp&1E=8xK_9EnbvJ3taYmTseH_$GQ^ zx}Bo^(YPE)$o_=vj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bh<`2Y=bhZV>jNdY3r&ba*kiEpMxE8dDM2dxhWEQ7~l76s)A2S zqDp<@crM+)q;2E-3gp=O6Z;o$1`H>Q?elhl86i8no0OcX!$K7U#f!J;Wk9O6_^ z`j4fWbhISvjL>Qq&ztTsA$J-Nn*X6fX4lFwpf zsv_jkQM9!a>MWjW4>GT}<;xfwSliiBINz53INiv@=|&_@H$+ldB#&{rF>`5t%b%>nDuebqmItRBH#prO5jrGC?c#8Mh134{ zX`F9x_WGE|s;B$g*j&trXooWAViV4HxO!V}w{g&~xtaOxj|&klPp+K(#UpM1MMh0|qze$yVt40%zZ= zh?hXhk!yba^0qe-H5ri3V+n^*IGj187pq+qzT;+jUH5)C3*G{84xMrNUL%V$zQ<65 z?Dil;Sb_I{y1~I)!Z3Hvu&US(!bGkd2EXrxCP0j+x;`LeE>(xn8nY*o2H`_pQAOko zQN}4Vi$u@P*UZCkJ@zk4y0H&G`9)J@v=5Vypa#|}66MF@_bLeX2;fN`7EcM0{K*j? zpX+;7e@iaKFHgthYu@YLYLIILek+goeej~%#`X?=9r35HBmM6pO-X{f|err#Ru z#9bo`L{W$%5?MQho$P&BX!PB53e8uu4=anCpLTuJ!3}wI7Tv3V!8eZe^R7c9g3Wn@$+Iv3V#Njk8lfl+P~*+%RkTW&|`h4f0-xb;bp7rK>Ss zkyLY{6o5yHVw7WW+iz23wCkHMoi88~t!yln*JK-oGK;13v8 zCj&gj^wjYY0Irzb#^(T#0y<-^02s!x*^2}p;Ra$mg-FUKi4D7-#9;2emm?;56>>_2 PvXjLi`(-KcOZ@%^HW8BR diff --git a/misc.h b/misc.h index d19c28e..7de519d 100644 --- a/misc.h +++ b/misc.h @@ -24,26 +24,22 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #endif -#define IS_MR_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= MR_CHANNEL_LAST) -#define IS_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST) -#define IS_VALID_CHANNEL(x) ((x) < LAST_CHANNEL) +#define IS_MR_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= MR_CHANNEL_LAST) +#define IS_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST) +#define IS_VALID_CHANNEL(x) ((x) < LAST_CHANNEL) -#ifdef ENABLE_NOAA - #define IS_NOAA_CHANNEL(x) ((x) >= NOAA_CHANNEL_FIRST && (x) <= NOAA_CHANNEL_LAST) - #define IS_NOT_NOAA_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST) -#endif +#define IS_NOAA_CHANNEL(x) ((x) >= NOAA_CHANNEL_FIRST && (x) <= NOAA_CHANNEL_LAST) +#define IS_NOT_NOAA_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST) -enum { +typedef enum { MR_CHANNEL_FIRST = 0, MR_CHANNEL_LAST = 199u, FREQ_CHANNEL_FIRST = 200u, FREQ_CHANNEL_LAST = 206u, - #ifdef ENABLE_NOAA - NOAA_CHANNEL_FIRST = 207u, - NOAA_CHANNEL_LAST = 216u, - #endif + NOAA_CHANNEL_FIRST = 207u, + NOAA_CHANNEL_LAST = 216u, LAST_CHANNEL -}; +} channel_num_t; enum { FLASHLIGHT_OFF = 0, diff --git a/radio.c b/radio.c index f712f2d..bced7d7 100644 --- a/radio.c +++ b/radio.c @@ -51,7 +51,7 @@ bool RADIO_CheckValidChannel(uint16_t Channel, bool bCheckScanList, uint8_t VFO) uint8_t PriorityCh1; uint8_t PriorityCh2; - if (!IS_MR_CHANNEL(Channel)) + if (Channel > MR_CHANNEL_LAST) return false; Attributes = gMR_ChannelAttributes[Channel]; @@ -176,7 +176,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure } #endif - if (IS_MR_CHANNEL(Channel)) + if (Channel <= MR_CHANNEL_LAST) { Channel = RADIO_FindNextChannel(Channel, RADIO_CHANNEL_UP, false, VFO); if (Channel == 0xFF) @@ -200,7 +200,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure uint8_t Index; - if (IS_MR_CHANNEL(Channel)) + if (Channel <= MR_CHANNEL_LAST) { Channel = gEeprom.FreqChannel[VFO]; gEeprom.ScreenChannel[VFO] = gEeprom.FreqChannel[VFO]; @@ -218,7 +218,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure Band = BAND6_400MHz; } - if (IS_MR_CHANNEL(Channel)) + if (Channel <= MR_CHANNEL_LAST) { gEeprom.VfoInfo[VFO].Band = Band; gEeprom.VfoInfo[VFO].SCANLIST1_PARTICIPATION = !!(Attributes & MR_CH_SCANLIST1); @@ -235,7 +235,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure gEeprom.VfoInfo[VFO].SCANLIST2_PARTICIPATION = bParticipation2; gEeprom.VfoInfo[VFO].CHANNEL_SAVE = Channel; - if (IS_MR_CHANNEL(Channel)) + if (Channel <= MR_CHANNEL_LAST) Base = Channel * 16; else Base = 0x0C80 + ((Channel - FREQ_CHANNEL_FIRST) * 32) + (VFO * 16); @@ -380,13 +380,13 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure if (Frequency >= 10800000 && Frequency < 13600000) gEeprom.VfoInfo[VFO].TX_OFFSET_FREQUENCY_DIRECTION = TX_OFFSET_FREQUENCY_DIRECTION_OFF; else - if (!IS_MR_CHANNEL(Channel)) + if (Channel > MR_CHANNEL_LAST) gEeprom.VfoInfo[VFO].TX_OFFSET_FREQUENCY = FREQUENCY_FloorToStep(gEeprom.VfoInfo[VFO].TX_OFFSET_FREQUENCY, gEeprom.VfoInfo[VFO].StepFrequency, 0); RADIO_ApplyOffset(pRadio); memset(gEeprom.VfoInfo[VFO].Name, 0, sizeof(gEeprom.VfoInfo[VFO].Name)); - if (IS_MR_CHANNEL(Channel)) + if (Channel < MR_CHANNEL_LAST) { // 16 bytes allocated to the channel name but only 10 used, the rest are 0's EEPROM_ReadBuffer(0x0F50 + (Channel * 16), gEeprom.VfoInfo[VFO].Name + 0, 8); EEPROM_ReadBuffer(0x0F58 + (Channel * 16), gEeprom.VfoInfo[VFO].Name + 8, 2); @@ -576,6 +576,9 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0) BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_GREEN, false); + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (Bandwidth) { default: @@ -591,6 +594,8 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0) break; } + #pragma GCC diagnostic pop + BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_RED, false); BK4819_SetupPowerAmplifier(0, 0); @@ -825,6 +830,9 @@ void RADIO_SetTxParameters(void) BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2, false); + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (Bandwidth) { default: @@ -840,6 +848,8 @@ void RADIO_SetTxParameters(void) break; } + #pragma GCC diagnostic pop + BK4819_SetFrequency(gCurrentVfo->pTX->Frequency); // TX compressor diff --git a/settings.c b/settings.c index 8bec24b..7755012 100644 --- a/settings.c +++ b/settings.c @@ -184,10 +184,6 @@ void SETTINGS_SaveSettings(void) EEPROM_WriteBuffer(0x0F40, State); } -void SETTINGS_LoadChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO) -{ -} - void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, uint8_t Mode) { #ifdef ENABLE_NOAA @@ -197,13 +193,13 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, const uint16_t OffsetMR = Channel * 16; uint16_t OffsetVFO = OffsetMR; - if (!IS_MR_CHANNEL(Channel)) + if (Channel > MR_CHANNEL_LAST) { // it's a VFO, not a channel OffsetVFO = (VFO == 0) ? 0x0C80 : 0x0C90; OffsetVFO += (Channel - FREQ_CHANNEL_FIRST) * 32; } - if (Mode >= 2 || !IS_MR_CHANNEL(Channel)) + if (Mode >= 2 || Channel > MR_CHANNEL_LAST) { // copy VFO to a channel uint8_t State[8]; @@ -228,8 +224,9 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, SETTINGS_UpdateChannel(Channel, pVFO, true); - if (IS_MR_CHANNEL(Channel)) - { + if (Channel <= MR_CHANNEL_LAST) + { // it's a memory channel + #ifndef ENABLE_KEEP_MEM_NAME // clear/reset the channel name //memset(&State, 0xFF, sizeof(State)); @@ -262,7 +259,7 @@ void SETTINGS_UpdateChannel(uint8_t Channel, const VFO_Info_t *pVFO, bool keep) uint8_t Attributes = 0xFF; // default attributes uint16_t Offset = 0x0D60 + (Channel & ~7u); - Attributes &= ~MR_CH_COMPAND; // default to '0' = compander disabled + Attributes &= (uint8_t)(~MR_CH_COMPAND); // default to '0' = compander disabled EEPROM_ReadBuffer(Offset, State, sizeof(State)); @@ -280,8 +277,9 @@ void SETTINGS_UpdateChannel(uint8_t Channel, const VFO_Info_t *pVFO, bool keep) gMR_ChannelAttributes[Channel] = Attributes; // #ifndef ENABLE_KEEP_MEM_NAME - if (IS_MR_CHANNEL(Channel)) - { + if (Channel <= MR_CHANNEL_LAST) + { // it's a memory channel + const uint16_t OffsetMR = Channel * 16; if (!keep) { // clear/reset the channel name diff --git a/ui/main.c b/ui/main.c index 3f2c910..c829cf3 100644 --- a/ui/main.c +++ b/ui/main.c @@ -14,6 +14,10 @@ * limitations under the License. */ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + #pragma GCC diagnostic pop + #include #include // abs() @@ -42,6 +46,9 @@ center_line_t center_line = CENTER_LINE_NONE; void UI_drawBars(uint8_t *p, const unsigned int level) { + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (level) { default: @@ -54,6 +61,8 @@ void UI_drawBars(uint8_t *p, const unsigned int level) case 1: memmove(p + 0, BITMAP_Antenna, sizeof(BITMAP_Antenna)); case 0: break; } + + #pragma GCC diagnostic pop } #ifdef ENABLE_AUDIO_BAR @@ -214,6 +223,8 @@ void UI_UpdateRSSI(const int16_t rssi, const int vfo) { #ifdef ENABLE_RSSI_BAR + (void)vfo; // unused + // optional larger RSSI dBm, S-point and bar level if (center_line != CENTER_LINE_RSSI) @@ -333,13 +344,13 @@ void UI_DisplayMain(void) for (vfo_num = 0; vfo_num < 2; vfo_num++) { const unsigned int line = (vfo_num == 0) ? line0 : line1; - uint8_t channel = gEeprom.TX_VFO; -// uint8_t tx_channel = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO; + unsigned int channel = gEeprom.TX_VFO; +// unsigned int tx_channel = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO; const bool same_vfo = (channel == vfo_num) ? true : false; uint8_t *p_line0 = gFrameBuffer[line + 0]; uint8_t *p_line1 = gFrameBuffer[line + 1]; - uint8_t mode = 0; - uint8_t state; + unsigned int mode = 0; + unsigned int state; if (single_vfo) { // we're in single VFO mode - screen is dedicated to just one VFO @@ -457,7 +468,7 @@ void UI_DisplayMain(void) } } - if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num])) + if (gEeprom.ScreenChannel[vfo_num] <= MR_CHANNEL_LAST) { // channel mode const unsigned int x = 2; const bool inputting = (gInputBoxIndex == 0 || gEeprom.TX_VFO != vfo_num) ? false : true; @@ -508,7 +519,7 @@ void UI_DisplayMain(void) if (state != VFO_STATE_NORMAL) { const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALARM", "VOLT HIGH"}; - if (state >= 0 && state < ARRAY_SIZE(state_list)) + if (state < ARRAY_SIZE(state_list)) UI_PrintString(state_list[state], 31, 0, line, 8); } else @@ -528,8 +539,8 @@ void UI_DisplayMain(void) frequency = gEeprom.VfoInfo[vfo_num].pTX->Frequency; } - if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num])) - { // channel mode + if (gEeprom.ScreenChannel[vfo_num] <= MR_CHANNEL_LAST) + { // it's a channel // show the channel symbols const uint8_t attributes = gMR_ChannelAttributes[gEeprom.ScreenChannel[vfo_num]]; @@ -546,6 +557,9 @@ void UI_DisplayMain(void) #endif + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (gEeprom.CHANNEL_DISPLAY_MODE) { case MDF_FREQUENCY: // show the channel frequency @@ -595,6 +609,8 @@ void UI_DisplayMain(void) break; } + + #pragma GCC diagnostic pop } else { // frequency mode @@ -660,7 +676,7 @@ void UI_DisplayMain(void) const FREQ_Config_t *pConfig = (mode == 1) ? gEeprom.VfoInfo[vfo_num].pTX : gEeprom.VfoInfo[vfo_num].pRX; const unsigned int code_type = pConfig->CodeType; const char *code_list[] = {"", "CT", "DCS", "DCR"}; - if (code_type >= 0 && code_type < ARRAY_SIZE(code_list)) + if (code_type < ARRAY_SIZE(code_list)) strcpy(String, code_list[code_type]); } UI_PrintStringSmall(String, LCD_WIDTH + 24, 0, line + 1); @@ -669,7 +685,7 @@ void UI_DisplayMain(void) { // show the TX power const char pwr_list[] = "LMH"; const unsigned int i = gEeprom.VfoInfo[vfo_num].OUTPUT_POWER; - String[0] = (i >= 0 && i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0'; + String[0] = (i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0'; String[1] = '\0'; UI_PrintStringSmall(String, LCD_WIDTH + 46, 0, line + 1); } diff --git a/ui/menu.c b/ui/menu.c index 424e137..26b3cc0 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -436,6 +436,9 @@ void UI_DisplayMenu(void) bool already_printed = false; + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (gMenuCursor) { case MENU_SQL: @@ -806,6 +809,8 @@ void UI_DisplayMenu(void) } } + #pragma GCC diagnostic pop + if (!already_printed) { // we now do multi-line text in a single string