diff --git a/app/app.c b/app/app.c index 784f7e8..4d2ce15 100644 --- a/app/app.c +++ b/app/app.c @@ -1931,27 +1931,33 @@ void APP_TimeSlice500ms(void) #endif } - #ifdef ENABLE_FMRADIO - if ((g_fm_scan_state == FM_SCAN_OFF || g_ask_to_save) && g_css_scan_mode == CSS_SCAN_MODE_OFF) - #else - if (g_css_scan_mode == CSS_SCAN_MODE_OFF) - #endif +#ifdef ENABLE_FMRADIO + if (g_fm_scan_state == FM_SCAN_OFF || g_ask_to_save) +#endif { - #ifdef ENABLE_AIRCOPY - if (g_screen_to_display != DISPLAY_AIRCOPY) - #endif + #ifdef ENABLE_AIRCOPY + if (g_screen_to_display != DISPLAY_AIRCOPY) + #endif { - if (g_scan_state_dir == SCAN_OFF && - (g_screen_to_display != DISPLAY_SCANNER || - g_scan_css_state == SCAN_CSS_STATE_FOUND || - g_scan_css_state == SCAN_CSS_STATE_FAILED || - g_scan_css_state == SCAN_CSS_STATE_FREQ_FAILED)) + if (g_css_scan_mode == CSS_SCAN_MODE_OFF && + g_scan_state_dir == SCAN_OFF && + (g_screen_to_display != DISPLAY_SCANNER || + g_scan_css_state == SCAN_CSS_STATE_FOUND || + g_scan_css_state == SCAN_CSS_STATE_FAILED || + g_scan_css_state == SCAN_CSS_STATE_FREQ_FAILED)) { - if (g_eeprom.auto_keypad_lock && g_key_lock_count_down_500ms > 0 && !g_dtmf_input_mode) + + if (g_eeprom.auto_keypad_lock && + g_key_lock_count_down_500ms > 0 && + !g_dtmf_input_mode && + g_input_box_index == 0 && + g_screen_to_display != DISPLAY_MENU) { if (--g_key_lock_count_down_500ms == 0) - g_eeprom.key_lock = true; // lock the keyboard - g_update_status = true; // lock symbol needs showing + { // lock the keyboard + g_eeprom.key_lock = true; + g_update_status = true; + } } if (exit_menu) @@ -2222,6 +2228,49 @@ static void APP_ProcessKey(const key_code_t Key, const bool key_pressed, const b if (g_eeprom.auto_keypad_lock) g_key_lock_count_down_500ms = key_lock_timeout_500ms; + if (g_eeprom.key_lock && g_current_function != FUNCTION_TRANSMIT && Key != KEY_PTT) + { // keyboard is locked + + if (Key == KEY_F) + { // function/key-lock key + + if (!key_pressed) + return; + + if (key_held) + { // unlock the keypad + g_eeprom.key_lock = false; + g_request_save_settings = true; + g_update_status = true; + + #ifdef ENABLE_VOICE + g_another_voice_id = VOICE_ID_UNLOCK; + #endif + + AUDIO_PlayBeep(BEEP_1KHZ_60MS_OPTIONAL); + } + + return; + } + + if (Key != KEY_SIDE1 && Key != KEY_SIDE2) + { + if (!key_pressed || key_held) + return; + + backlight_turn_on(); + + g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; +// AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL); + + // keypad is locked, tell the user + g_keypad_locked = 4; // 2 second pop-up + g_update_display = true; + + return; + } + } + if (!key_pressed) { if (g_flag_SaveVfo) @@ -2255,7 +2304,8 @@ static void APP_ProcessKey(const key_code_t Key, const bool key_pressed, const b GUI_SelectNextDisplay(DISPLAY_MAIN); } } - else + + if (key_pressed) { if (Key != KEY_PTT || g_setting_backlight_on_tx_rx == 1 || g_setting_backlight_on_tx_rx == 3) backlight_turn_on(); @@ -2292,37 +2342,6 @@ static void APP_ProcessKey(const key_code_t Key, const bool key_pressed, const b } } - if (g_eeprom.key_lock && g_current_function != FUNCTION_TRANSMIT && Key != KEY_PTT) - { // keyboard is locked - - if (Key == KEY_F) - { // function/key-lock key - - if (!key_pressed) - return; - - if (!key_held) - { // keypad is locked, tell the user - AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL); - g_keypad_locked = 4; // 2 seconds - g_update_display = true; - return; - } - } - else - if (Key != KEY_SIDE1 && Key != KEY_SIDE2) - { - if (!key_pressed || key_held) - return; - - // keypad is locked, tell the user - AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL); - g_keypad_locked = 4; // 2 seconds - g_update_display = true; - return; - } - } - #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtype-limits" diff --git a/app/fm.c b/app/fm.c index 41fe65a..e985216 100644 --- a/app/fm.c +++ b/app/fm.c @@ -14,8 +14,6 @@ * limitations under the License. */ -#ifdef ENABLE_FMRADIO - #include #include "app/action.h" @@ -155,7 +153,7 @@ void FM_PlayAndUpdate(void) if (g_fm_auto_scan) { - g_eeprom.fm_is_channel_mode = true; + g_eeprom.fm_is_channel_mode = true; g_eeprom.fm_selected_channel = 0; } @@ -184,7 +182,9 @@ int FM_CheckFrequencyLock(uint16_t Frequency, uint16_t LowerLimit) if (BK1080_REG_07_GET_SNR(Test2) >= 2) { const uint16_t Status = BK1080_ReadRegister(BK1080_REG_10); - if ((Status & BK1080_REG_10_MASK_AFCRL) == BK1080_REG_10_AFCRL_NOT_RAILED && BK1080_REG_10_GET_RSSI(Status) >= 10) + + if ((Status & BK1080_REG_10_MASK_AFCRL) == BK1080_REG_10_AFCRL_NOT_RAILED && + BK1080_REG_10_GET_RSSI(Status) >= 10) { //if (Deviation > -281 && Deviation < 280) if (Deviation < 280 || Deviation > 3815) @@ -227,168 +227,186 @@ Bail: static void FM_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held) { #define STATE_FREQ_MODE 0 - #define STATE_USER_MODE 1 + #define STATE_USER_MODE 1 #define STATE_SAVE 2 - if (!key_held && key_pressed) + if (key_held) { - if (!g_fkey_pressed) + if (key_pressed) + return; + + return; // no sofiticatedness here - yet + } + + if (key_pressed) + { + g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; + return; + } + + if (!g_fkey_pressed) + { + uint8_t State; + + if (g_ask_to_delete) { - uint8_t State; - - if (g_ask_to_delete) - { - g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; - return; - } - - if (g_ask_to_save) - { - State = STATE_SAVE; - } - else - { - if (g_fm_scan_state != FM_SCAN_OFF) - { - g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; - return; - } - - State = g_eeprom.fm_is_channel_mode ? STATE_USER_MODE : STATE_FREQ_MODE; - } - - INPUTBOX_Append(Key); - - g_request_display_screen = DISPLAY_FM; - - if (State == STATE_FREQ_MODE) - { - if (g_input_box_index == 1) - { - if (g_input_box[0] > 1) - { - g_input_box[1] = g_input_box[0]; - g_input_box[0] = 0; - g_input_box_index = 2; - } - } - else - if (g_input_box_index > 3) - { - uint32_t Frequency; - - g_input_box_index = 0; - NUMBER_Get(g_input_box, &Frequency); - Frequency /= 10000; - - if (Frequency < g_eeprom.fm_lower_limit || g_eeprom.fm_upper_limit < Frequency) - { - g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; - g_request_display_screen = DISPLAY_FM; - return; - } - - g_eeprom.fm_selected_frequency = (uint16_t)Frequency; - - #ifdef ENABLE_VOICE - g_another_voice_id = (voice_id_t)Key; - #endif - - g_eeprom.fm_frequency_playing = g_eeprom.fm_selected_frequency; - BK1080_SetFrequency(g_eeprom.fm_frequency_playing); - g_request_save_fm = true; - return; - } - } - else - if (g_input_box_index == 2) - { - uint8_t Channel; - - g_input_box_index = 0; - Channel = ((g_input_box[0] * 10) + g_input_box[1]) - 1; - - if (State == STATE_USER_MODE) - { - if (FM_CheckValidChannel(Channel)) - { - #ifdef ENABLE_VOICE - g_another_voice_id = (voice_id_t)Key; - #endif - g_eeprom.fm_selected_channel = Channel; - g_eeprom.fm_frequency_playing = g_fm_channels[Channel]; - BK1080_SetFrequency(g_eeprom.fm_frequency_playing); - g_request_save_fm = true; - return; - } - } - else - if (Channel < 20) - { - #ifdef ENABLE_VOICE - g_another_voice_id = (voice_id_t)Key; - #endif - g_request_display_screen = DISPLAY_FM; - g_input_box_index = 0; - g_fm_channel_position = Channel; - return; - } - - g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; - return; - } - - #ifdef ENABLE_VOICE - g_another_voice_id = (voice_id_t)Key; - #endif - + g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; return; } - - g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; - g_fkey_pressed = false; - g_update_status = true; - g_request_display_screen = DISPLAY_FM; - - switch (Key) + + if (g_ask_to_save) { - case KEY_0: - ACTION_FM(); - break; - - case KEY_1: - g_eeprom.fm_is_channel_mode = !g_eeprom.fm_is_channel_mode; - - if (!FM_ConfigureChannelState()) + State = STATE_SAVE; + } + else + { + if (g_fm_scan_state != FM_SCAN_OFF) + { + g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; + return; + } + + State = g_eeprom.fm_is_channel_mode ? STATE_USER_MODE : STATE_FREQ_MODE; + } + + INPUTBOX_Append(Key); + + g_request_display_screen = DISPLAY_FM; + + if (State == STATE_FREQ_MODE) + { + if (g_input_box_index == 1) + { + if (g_input_box[0] > 1) { + g_input_box[1] = g_input_box[0]; + g_input_box[0] = 0; + g_input_box_index = 2; + } + } + else + if (g_input_box_index > 3) + { + uint32_t Frequency; + + g_input_box_index = 0; + NUMBER_Get(g_input_box, &Frequency); + Frequency /= 10000; + + if (Frequency < g_eeprom.fm_lower_limit || g_eeprom.fm_upper_limit < Frequency) + { + g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; + g_request_display_screen = DISPLAY_FM; + return; + } + + g_eeprom.fm_selected_frequency = (uint16_t)Frequency; + + #ifdef ENABLE_VOICE + g_another_voice_id = (voice_id_t)Key; + #endif + + g_eeprom.fm_frequency_playing = g_eeprom.fm_selected_frequency; + BK1080_SetFrequency(g_eeprom.fm_frequency_playing); + g_request_save_fm = true; + return; + } + } + else + if (g_input_box_index == 2) + { + uint8_t Channel; + + g_input_box_index = 0; + Channel = ((g_input_box[0] * 10) + g_input_box[1]) - 1; + + if (State == STATE_USER_MODE) + { + if (FM_CheckValidChannel(Channel)) + { + #ifdef ENABLE_VOICE + g_another_voice_id = (voice_id_t)Key; + #endif + g_eeprom.fm_selected_channel = Channel; + g_eeprom.fm_frequency_playing = g_fm_channels[Channel]; BK1080_SetFrequency(g_eeprom.fm_frequency_playing); g_request_save_fm = true; + return; } - else - g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; - break; - - case KEY_2: - ACTION_Scan(true); - break; - - case KEY_3: - ACTION_Scan(false); - break; - - default: - g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; - break; + } + else + if (Channel < 20) + { + #ifdef ENABLE_VOICE + g_another_voice_id = (voice_id_t)Key; + #endif + g_request_display_screen = DISPLAY_FM; + g_input_box_index = 0; + g_fm_channel_position = Channel; + return; + } + + g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; + return; } + + #ifdef ENABLE_VOICE + g_another_voice_id = (voice_id_t)Key; + #endif + + return; } + + g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; + g_fkey_pressed = false; + g_update_status = true; + g_request_display_screen = DISPLAY_FM; + + switch (Key) + { + case KEY_0: + ACTION_FM(); + break; + + case KEY_3: + g_eeprom.fm_is_channel_mode = !g_eeprom.fm_is_channel_mode; + + if (!FM_ConfigureChannelState()) + { + BK1080_SetFrequency(g_eeprom.fm_frequency_playing); + g_request_save_fm = true; + } + else + g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; + break; + + default: + g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; + break; + } +} + +static void FM_Key_STAR(bool key_pressed, bool key_held) +{ +// if (key_held) +// return; + + if (key_pressed) + return; + + g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; + + ACTION_Scan(false); } static void FM_Key_EXIT(bool key_pressed, bool key_held) { if (key_held) + { return; - - if (!key_pressed) + } + + if (key_pressed) return; g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; @@ -446,9 +464,11 @@ static void FM_Key_EXIT(bool key_pressed, bool key_held) static void FM_Key_MENU(bool key_pressed, bool key_held) { if (key_held) + { return; - - if (!key_pressed) + } + + if (key_pressed) return; g_request_display_screen = DISPLAY_FM; @@ -599,6 +619,9 @@ void FM_ProcessKeys(key_code_t Key, bool key_pressed, bool key_held) case KEY_DOWN: FM_Key_UP_DOWN(key_pressed, key_held, -1); break;; + case KEY_STAR: + FM_Key_STAR(key_pressed, key_held); + break; case KEY_EXIT: FM_Key_EXIT(key_pressed, key_held); break; @@ -666,5 +689,3 @@ void FM_Start(void) g_enable_speaker = true; g_update_status = true; } - -#endif diff --git a/app/fm.h b/app/fm.h index 57ed849..7cc0a40 100644 --- a/app/fm.h +++ b/app/fm.h @@ -17,15 +17,13 @@ #ifndef APP_FM_H #define APP_FM_H -#ifdef ENABLE_FMRADIO - #include "driver/keyboard.h" #define FM_CHANNEL_UP 0x01 #define FM_CHANNEL_DOWN 0xFF enum { - FM_SCAN_OFF = 0U, + FM_SCAN_OFF = 0, }; extern uint16_t g_fm_channels[20]; @@ -59,5 +57,3 @@ void FM_Start(void); #endif -#endif - diff --git a/app/generic.c b/app/generic.c index af082eb..462a8c3 100644 --- a/app/generic.c +++ b/app/generic.c @@ -36,6 +36,8 @@ void GENERIC_Key_F(bool key_pressed, bool key_held) { + g_key_input_count_down = key_input_timeout_500ms; + if (g_input_box_index > 0) { if (!key_held && key_pressed) @@ -43,80 +45,46 @@ void GENERIC_Key_F(bool key_pressed, bool key_held) return; } - if (key_held || !key_pressed) - { - if (key_held || key_pressed) - { - if (!key_held) - return; + if (key_held) + { // f-key held - if (!key_pressed) - return; - - #ifdef ENABLE_FMRADIO - if (!g_fm_radio_mode) - #endif - { - if (g_screen_to_display != DISPLAY_MENU && - g_screen_to_display != DISPLAY_FM && - g_current_function != FUNCTION_TRANSMIT) - { // toggle the keyboad lock - - #ifdef ENABLE_VOICE - g_another_voice_id = g_eeprom.key_lock ? VOICE_ID_UNLOCK : VOICE_ID_LOCK; - #endif - - g_eeprom.key_lock = !g_eeprom.key_lock; - - g_request_save_settings = true; - } - } - } - else - { - #ifdef ENABLE_FMRADIO - if ((g_fm_radio_mode || g_screen_to_display != DISPLAY_MAIN) && - g_screen_to_display != DISPLAY_FM) - return; - #else - if (g_screen_to_display != DISPLAY_MAIN) - return; - #endif - - // toggle the fkey on/off - g_fkey_pressed = !g_fkey_pressed; - - if (g_fkey_pressed) - g_key_input_count_down = key_input_timeout_500ms; + if (key_pressed && g_screen_to_display != DISPLAY_MENU && g_current_function != FUNCTION_TRANSMIT) + { // toggle the keyboad lock #ifdef ENABLE_VOICE - if (!g_fkey_pressed) - g_another_voice_id = VOICE_ID_CANCEL; + g_another_voice_id = g_eeprom.key_lock ? VOICE_ID_UNLOCK : VOICE_ID_LOCK; #endif - g_update_status = true; + g_eeprom.key_lock = !g_eeprom.key_lock; + g_request_save_settings = true; + g_update_status = true; + + // keypad is locked, tell the user + g_keypad_locked = 4; // 2 second pop-up + g_update_display = true; } + + return; } - else + + if (key_pressed) { - if (g_screen_to_display != DISPLAY_FM) - { - g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; - return; - } - - #ifdef ENABLE_FMRADIO - if (g_fm_scan_state == FM_SCAN_OFF) - { - g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; - return; - } - #endif - - g_beep_to_play = BEEP_440HZ_500MS; - -// g_ptt_was_released = true; // why is this being set ??? + g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; + return; } + + if (g_current_function == FUNCTION_TRANSMIT) + return; + + // toggle the f-key flag + g_fkey_pressed = !g_fkey_pressed; + + #ifdef ENABLE_VOICE + if (!g_fkey_pressed) + g_another_voice_id = VOICE_ID_CANCEL; + #endif + + g_update_status = true; } void GENERIC_Key_PTT(bool key_pressed) diff --git a/app/menu.c b/app/menu.c index 954e644..b13081a 100644 --- a/app/menu.c +++ b/app/menu.c @@ -595,8 +595,8 @@ void MENU_AcceptSetting(void) break; case MENU_AUTOLK: - g_eeprom.auto_keypad_lock = g_sub_menu_selection; - g_key_lock_count_down_500ms = 30; + g_eeprom.auto_keypad_lock = g_sub_menu_selection; + g_key_lock_count_down_500ms = key_lock_timeout_500ms; break; case MENU_S_ADD1: diff --git a/board.c b/board.c index 2fc60a8..4007a27 100644 --- a/board.c +++ b/board.c @@ -591,14 +591,14 @@ void BOARD_EEPROM_Init(void) // 0E90..0E97 EEPROM_ReadBuffer(0x0E90, Data, 8); - g_eeprom.beep_control = (Data[0] < 2) ? Data[0] : true; - g_eeprom.key1_short_press_action = (Data[1] < ACTION_OPT_LEN) ? Data[1] : ACTION_OPT_MONITOR; - g_eeprom.key1_long_press_action = (Data[2] < ACTION_OPT_LEN) ? Data[2] : ACTION_OPT_FLASHLIGHT; - g_eeprom.key2_short_press_action = (Data[3] < ACTION_OPT_LEN) ? Data[3] : ACTION_OPT_SCAN; - g_eeprom.key2_long_press_action = (Data[4] < ACTION_OPT_LEN) ? Data[4] : ACTION_OPT_NONE; - g_eeprom.scan_resume_mode = (Data[5] < 3) ? Data[5] : SCAN_RESUME_CO; - g_eeprom.auto_keypad_lock = (Data[6] < 2) ? Data[6] : false; - g_eeprom.pwr_on_display_mode = (Data[7] < 4) ? Data[7] : PWR_ON_DISPLAY_MODE_VOLTAGE; + g_eeprom.beep_control = (Data[0] < 2) ? Data[0] : true; + g_eeprom.key1_short_press_action = (Data[1] < ACTION_OPT_LEN) ? Data[1] : ACTION_OPT_MONITOR; + g_eeprom.key1_long_press_action = (Data[2] < ACTION_OPT_LEN) ? Data[2] : ACTION_OPT_FLASHLIGHT; + g_eeprom.key2_short_press_action = (Data[3] < ACTION_OPT_LEN) ? Data[3] : ACTION_OPT_SCAN; + g_eeprom.key2_long_press_action = (Data[4] < ACTION_OPT_LEN) ? Data[4] : ACTION_OPT_NONE; + g_eeprom.scan_resume_mode = (Data[5] < 3) ? Data[5] : SCAN_RESUME_CO; + g_eeprom.auto_keypad_lock = (Data[6] < 2) ? Data[6] : false; + g_eeprom.pwr_on_display_mode = (Data[7] < 4) ? Data[7] : PWR_ON_DISPLAY_MODE_VOLTAGE; // 0E98..0E9F EEPROM_ReadBuffer(0x0E98, Data, 8); diff --git a/firmware.bin b/firmware.bin index af87fcb..541a709 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 6950ff7..c4abb4d 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/ui/fmradio.c b/ui/fmradio.c index df8e5f5..02b7a4f 100644 --- a/ui/fmradio.c +++ b/ui/fmradio.c @@ -19,6 +19,7 @@ #include #include "app/fm.h" +#include "driver/backlight.h" #include "driver/st7565.h" #include "external/printf/printf.h" #include "misc.h" @@ -35,11 +36,23 @@ void UI_DisplayFM(void) memset(g_frame_buffer, 0, sizeof(g_frame_buffer)); - memset(String, 0, sizeof(String)); - strcpy(String, "FM"); - UI_PrintString(String, 0, 127, 0, 12); + // ************************************* + + if (g_eeprom.key_lock && g_keypad_locked > 0) + { // tell user how to unlock the keyboard + backlight_turn_on(); + UI_PrintString("Long press #", 0, LCD_WIDTH, 1, 8); + UI_PrintString("to unlock", 0, LCD_WIDTH, 3, 8); + ST7565_BlitFullScreen(); + return; + } + + // ************************************* + + UI_PrintString("FM", 0, 127, 0, 12); + + // ************************************* - memset(String, 0, sizeof(String)); if (g_ask_to_save) { strcpy(String, "SAVE?"); @@ -51,11 +64,13 @@ void UI_DisplayFM(void) } else { + memset(String, 0, sizeof(String)); + if (g_fm_scan_state == FM_SCAN_OFF) { if (!g_eeprom.fm_is_channel_mode) { - for (i = 0; i < 20; i++) + for (i = 0; i < ARRAY_SIZE(g_fm_channels); i++) { if (g_eeprom.fm_frequency_playing == g_fm_channels[i]) { @@ -64,23 +79,25 @@ void UI_DisplayFM(void) } } - if (i == 20) + if (i >= ARRAY_SIZE(g_fm_channels)) strcpy(String, "VFO"); } else sprintf(String, "MR(CH%02u)", g_eeprom.fm_selected_channel + 1); } else - { - if (!g_fm_auto_scan) - strcpy(String, "M-SCAN"); - else - sprintf(String, "A-SCAN(%u)", g_fm_channel_position + 1); - } + if (!g_fm_auto_scan) + strcpy(String, "M-SCAN"); + else + sprintf(String, "A-SCAN(%u)", g_fm_channel_position + 1); } + UI_PrintString(String, 0, 127, 2, 10); + // ************************************* + memset(String, 0, sizeof(String)); + if (g_ask_to_save || (g_eeprom.fm_is_channel_mode && g_input_box_index > 0)) { UI_GenerateChannelString(String, g_fm_channel_position); @@ -94,16 +111,17 @@ void UI_DisplayFM(void) UI_DisplayFrequency(String, 23, 4, false, true); } else + { UI_DisplayFrequency(g_input_box, 23, 4, true, false); - - ST7565_BlitFullScreen(); - return; + } } else { sprintf(String, "CH-%02u", g_eeprom.fm_selected_channel + 1); + UI_PrintString(String, 0, 127, 4, 10); } - UI_PrintString(String, 0, 127, 4, 10); + + // ************************************* ST7565_BlitFullScreen(); }