diff --git a/app/action.c b/app/action.c index 1599874..cea4124 100644 --- a/app/action.c +++ b/app/action.c @@ -39,9 +39,6 @@ #include "ui/inputbox.h" #include "ui/ui.h" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - static void ACTION_FlashLight(void) { switch (g_flash_light_state) @@ -63,6 +60,8 @@ static void ACTION_FlashLight(void) case FLASHLIGHT_SOS: + // Fallthrough + default: g_flash_light_state = FLASHLIGHT_OFF; GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); @@ -428,5 +427,3 @@ void ACTION_process(const key_code_t Key, const bool key_pressed, const bool key break; } } - -#pragma GCC diagnostic pop diff --git a/app/app.c b/app/app.c index 9a37ce5..c22ce9c 100644 --- a/app/app.c +++ b/app/app.c @@ -78,9 +78,6 @@ const uint8_t orig_lna = 5; // -4dB const uint8_t orig_mixer = 3; // 0dB const uint8_t orig_pga = 6; // -3dB -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - static void APP_process_key(const key_code_t Key, const bool key_pressed, const bool key_held); static void APP_update_rssi(const int vfo) @@ -742,6 +739,8 @@ static void APP_next_channel(void) } } + // Fallthrough + case SCAN_NEXT_CHAN_SCANLIST2: if (chan2 >= 0) { @@ -753,6 +752,8 @@ static void APP_next_channel(void) } } + // Fallthrough + // this bit doesn't yet work if the other VFO is a frequency case SCAN_NEXT_CHAN_DUAL_WATCH: // dual watch is enabled - include the other VFO in the scan @@ -768,6 +769,8 @@ static void APP_next_channel(void) // } // } + // Fallthrough + default: case SCAN_NEXT_CHAN_USER: g_scan_current_scan_list = SCAN_NEXT_CHAN_USER; @@ -1433,11 +1436,11 @@ void APP_process_flash_light_10ms(void) case FLASHLIGHT_SOS: { // 150ms tick - // '15' sets the morse speed, lower value = faster speed + // '16' sets the morse speed, lower value = faster speed // '+ 6' lengthens the loop time const unsigned int num_bits = sizeof(sos) * 8; - const unsigned int bit = (g_flash_light_blink_tick_10ms / 15) % (num_bits + 6); - if (bit < num_bits && (sos & (1u << ((num_bits - 1) - bit)))) + const unsigned int bit = (g_flash_light_blink_tick_10ms / 16) % (num_bits + 6); + if (bit < num_bits && (sos & (1u << (num_bits - 1 - bit)))) GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // ON else GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // OFF @@ -3018,6 +3021,3 @@ Skip: g_request_display_screen = DISPLAY_INVALID; g_update_display = true; } - -#pragma GCC diagnostic pop - diff --git a/app/dtmf.c b/app/dtmf.c index eacb291..d812422 100644 --- a/app/dtmf.c +++ b/app/dtmf.c @@ -361,13 +361,13 @@ void DTMF_HandleRequest(void) g_update_display = true; - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (g_eeprom.dtmf_decode_response) { case DTMF_DEC_RESPONSE_BOTH: g_dtmf_decode_ring_tick_500ms = dtmf_decode_ring_500ms; + + // Fallthrough + case DTMF_DEC_RESPONSE_REPLY: g_dtmf_reply_state = DTMF_REPLY_AAAAA; break; @@ -381,8 +381,6 @@ void DTMF_HandleRequest(void) break; } - #pragma GCC diagnostic pop - if (g_dtmf_IsGroupCall) g_dtmf_reply_state = DTMF_REPLY_NONE; } diff --git a/app/menu.c b/app/menu.c index 5432643..be16ac4 100644 --- a/app/menu.c +++ b/app/menu.c @@ -458,11 +458,11 @@ void MENU_AcceptSetting(void) g_request_save_channel = 1; return; - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - case MENU_TX_CTCSS: pConfig = &g_tx_vfo->freq_config_tx; + + // Fallthrough + case MENU_RX_CTCSS: if (g_sub_menu_selection == 0) { @@ -489,8 +489,6 @@ void MENU_AcceptSetting(void) g_request_save_channel = 1; return; - #pragma GCC diagnostic pop - case MENU_SHIFT_DIR: g_tx_vfo->tx_offset_freq_dir = g_sub_menu_selection; g_request_save_channel = 1; @@ -1369,7 +1367,7 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtype-limits" - + if (Key >= KEY_0 && Key <= KEY_9) { g_edit[g_edit_index] = '0' + Key - KEY_0; @@ -1395,9 +1393,6 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held) if (!g_in_sub_menu) { - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (g_input_box_index) { case 2: @@ -1418,6 +1413,8 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held) g_input_box[0] = g_input_box[1]; g_input_box_index = 1; + // Fallthrough + case 1: value = g_input_box[0]; if (value > 0 && value <= g_menu_list_count) @@ -1429,8 +1426,6 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held) break; } - #pragma GCC diagnostic pop - g_input_box_index = 0; g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; @@ -1891,9 +1886,6 @@ static void MENU_Key_UP_DOWN(bool key_pressed, bool key_held, int8_t Direction) VFO = 0; - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (g_menu_cursor) { case MENU_OFFSET: @@ -1932,6 +1924,9 @@ static void MENU_Key_UP_DOWN(bool key_pressed, bool key_held, int8_t Direction) case MENU_SLIST2: VFO = 1; + + // Fallthrough + case MENU_SLIST1: bCheckScanList = true; break; @@ -1942,8 +1937,6 @@ static void MENU_Key_UP_DOWN(bool key_pressed, bool key_held, int8_t Direction) return; } - #pragma GCC diagnostic pop - Channel = RADIO_FindNextChannel(g_sub_menu_selection + Direction, Direction, bCheckScanList, VFO); if (Channel != 0xFF) g_sub_menu_selection = Channel; diff --git a/app/search.c b/app/search.c index 5cb375c..f6a0a12 100644 --- a/app/search.c +++ b/app/search.c @@ -98,9 +98,6 @@ static void SEARCH_Key_EXIT(bool key_pressed, bool key_held) g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (g_search_edit_state) { case SEARCH_EDIT_STATE_NONE: @@ -128,6 +125,8 @@ static void SEARCH_Key_EXIT(bool key_pressed, bool key_held) break; } + // Fallthrough + case SEARCH_EDIT_STATE_SAVE_CONFIRM: g_search_edit_state = SEARCH_EDIT_STATE_NONE; @@ -139,8 +138,6 @@ static void SEARCH_Key_EXIT(bool key_pressed, bool key_held) g_update_display = true; break; } - - #pragma GCC diagnostic pop } static void SEARCH_Key_MENU(bool key_pressed, bool key_held) @@ -173,9 +170,6 @@ static void SEARCH_Key_MENU(bool key_pressed, bool key_held) g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (g_search_edit_state) { case SEARCH_EDIT_STATE_NONE: @@ -227,12 +221,13 @@ static void SEARCH_Key_MENU(bool key_pressed, bool key_held) if (g_input_box_index == 0) { - g_search_edit_state = SEARCH_EDIT_STATE_SAVE_CONFIRM; - + g_search_edit_state = SEARCH_EDIT_STATE_SAVE_CONFIRM; g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; g_request_display_screen = DISPLAY_SEARCH; } + // Fallthrough + // break; case SEARCH_EDIT_STATE_SAVE_CONFIRM: @@ -305,8 +300,6 @@ static void SEARCH_Key_MENU(bool key_pressed, bool key_held) g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; break; } - - #pragma GCC diagnostic pop } static void SEARCH_Key_STAR(bool key_pressed, bool key_held) diff --git a/audio.c b/audio.c index 3a04791..11e273c 100644 --- a/audio.c +++ b/audio.c @@ -156,9 +156,6 @@ 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: @@ -167,6 +164,8 @@ void AUDIO_PlayBeep(beep_type_t Beep) BK4819_EnterTxMute(); SYSTEM_DelayMs(20); + // Fallthrough + case BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL: case BEEP_500HZ_60MS_DOUBLE_BEEP: BK4819_ExitTxMute(); @@ -174,6 +173,8 @@ void AUDIO_PlayBeep(beep_type_t Beep) BK4819_EnterTxMute(); SYSTEM_DelayMs(20); + // Fallthrough + case BEEP_1KHZ_60MS_OPTIONAL: BK4819_ExitTxMute(); Duration = 60; @@ -198,8 +199,6 @@ void AUDIO_PlayBeep(beep_type_t Beep) break; } - #pragma GCC diagnostic pop - SYSTEM_DelayMs(Duration); BK4819_EnterTxMute(); diff --git a/firmware.bin b/firmware.bin index 0be9d9a..eb2fdcd 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index ecca704..ad0e139 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/radio.c b/radio.c index 77ee237..05c71ef 100644 --- a/radio.c +++ b/radio.c @@ -126,7 +126,7 @@ void RADIO_InitInfo(vfo_info_t *p_vfo, const uint8_t ChannelSave, const uint32_t { if (p_vfo == NULL) return; - + memset(p_vfo, 0, sizeof(*p_vfo)); p_vfo->band = FREQUENCY_GetBand(Frequency); @@ -346,11 +346,11 @@ void RADIO_configure_channel(const unsigned int VFO, const unsigned int configur p_vfo->frequency_reverse = 0; p_vfo->tx_offset_freq_dir = TX_OFFSET_FREQ_DIR_OFF; p_vfo->tx_offset_freq = 0; - - + + // TODO: also update other settings such as step size - - + + } p_vfo->freq_config_rx.frequency = Frequency; @@ -425,7 +425,7 @@ void RADIO_ConfigureSquelchAndOutputPower(vfo_info_t *p_vfo) Base = (Band < BAND4_174MHz) ? 0x1E60 : 0x1E00; squelch_level = (p_vfo->squelch_level > 0) ? p_vfo->squelch_level : g_eeprom.squelch_level; - + // note that 'noise' and 'glitch' values are inverted compared to 'rssi' values if (squelch_level == 0) @@ -547,7 +547,7 @@ void RADIO_ConfigureSquelchAndOutputPower(vfo_info_t *p_vfo) // make low and mid even lower if (p_vfo->output_power == OUTPUT_POWER_LOW) { - TX_power[0] /= 5; //TX_power[0] /= 8; + TX_power[0] /= 5; //TX_power[0] /= 8; TX_power[1] /= 5; //TX_power[1] /= 8; TX_power[2] /= 5; //TX_power[2] /= 8; get more low power } @@ -638,13 +638,13 @@ void RADIO_setup_registers(bool switch_to_function_foreground) BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_GREEN, false); - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (Bandwidth) { default: Bandwidth = BK4819_FILTER_BW_WIDE; + + // Fallthrough + case BK4819_FILTER_BW_WIDE: case BK4819_FILTER_BW_NARROW: #ifdef ENABLE_AM_FIX @@ -656,8 +656,6 @@ void RADIO_setup_registers(bool switch_to_function_foreground) break; } - #pragma GCC diagnostic pop - BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1_RED, false); // LED off BK4819_SetupPowerAmplifier(0, 0); BK4819_set_GPIO_pin(BK4819_GPIO1_PIN29_PA_ENABLE, false); // PA off @@ -895,13 +893,13 @@ void RADIO_enableTX(const bool fsk_tx) BK4819_set_GPIO_pin(BK4819_GPIO0_PIN28_RX_ENABLE, false); - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (Bandwidth) { default: Bandwidth = BK4819_FILTER_BW_WIDE; + + // Fallthrough + case BK4819_FILTER_BW_WIDE: case BK4819_FILTER_BW_NARROW: #ifdef ENABLE_AM_FIX @@ -913,8 +911,6 @@ void RADIO_enableTX(const bool fsk_tx) break; } - #pragma GCC diagnostic pop - // if DTMF is enabled when TX'ing, it changes the TX audio filtering ! .. 1of11 // so MAKE SURE that DTMF is disabled - until needed BK4819_DisableDTMF(); @@ -1180,6 +1176,6 @@ void RADIO_tx_eot(void) { BK4819_PlayTone(APOLLO_TONE2_HZ, APOLLO_TONE_MS, 28); } - + BK4819_ExitDTMF_TX(true); } diff --git a/ui/aircopy.c b/ui/aircopy.c index d22f65d..d3a662a 100644 --- a/ui/aircopy.c +++ b/ui/aircopy.c @@ -87,9 +87,6 @@ void UI_DisplayAircopy(void) // ********************************** // lower TX/RX status text line - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (g_aircopy_state) { case AIRCOPY_READY: @@ -132,8 +129,6 @@ void UI_DisplayAircopy(void) break; } - #pragma GCC diagnostic pop - // ********************************** ST7565_BlitFullScreen(); diff --git a/ui/main.c b/ui/main.c index 62ab581..2ab574e 100644 --- a/ui/main.c +++ b/ui/main.c @@ -14,10 +14,6 @@ * limitations under the License. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" -#pragma GCC diagnostic pop - #include #include // abs() @@ -681,8 +677,6 @@ void UI_DisplayMain(void) if (g_eeprom.screen_channel[vfo_num] <= USER_CHANNEL_LAST) { // it's a channel - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" switch (g_eeprom.channel_display_mode) { @@ -741,8 +735,6 @@ void UI_DisplayMain(void) break; } - - #pragma GCC diagnostic pop } else // if (IS_FREQ_CHANNEL(g_eeprom.screen_channel[vfo_num])) diff --git a/ui/menu.c b/ui/menu.c index b69357b..1244276 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -555,9 +555,6 @@ void UI_DisplayMenu(void) bool already_printed = false; - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (g_menu_cursor) { case MENU_SQL: @@ -1185,8 +1182,6 @@ void UI_DisplayMenu(void) } } - #pragma GCC diagnostic pop - if (!already_printed) { // we now do multi-line text in a single string diff --git a/ui/search.c b/ui/search.c index d7aff19..92ea1f8 100644 --- a/ui/search.c +++ b/ui/search.c @@ -43,9 +43,6 @@ void UI_DisplaySearch(void) // *********************************** // frequency text line - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (g_search_css_state) { default: @@ -56,6 +53,8 @@ void UI_DisplaySearch(void) break; } + // Fallthrough + case SEARCH_CSS_STATE_SCANNING: case SEARCH_CSS_STATE_FOUND: case SEARCH_CSS_STATE_FAILED: @@ -71,8 +70,6 @@ void UI_DisplaySearch(void) break; } - #pragma GCC diagnostic pop - UI_PrintString(String, 2, 0, 1, 8); // *********************************** @@ -124,9 +121,6 @@ void UI_DisplaySearch(void) memset(String, 0, sizeof(String)); - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" - switch (g_search_edit_state) { default: @@ -155,6 +149,8 @@ void UI_DisplaySearch(void) break; } + // Fallthrough + case SEARCH_CSS_STATE_FREQ_FAILED: case SEARCH_CSS_STATE_REPEAT: strcpy(String, "* repeat"); @@ -181,8 +177,6 @@ void UI_DisplaySearch(void) break; } - #pragma GCC diagnostic pop - UI_PrintString(String, text_centered ? 0 : 2, text_centered ? 127 : 0, 5, 8); // ***********************************