From 5869b13e158b025be85e0f9f16fc8eb23446b8bc Mon Sep 17 00:00:00 2001 From: reppad Date: Thu, 16 Nov 2023 23:27:55 +0100 Subject: [PATCH] Fix part of issue #1 VO/SQ indicators Scan resume menu Missing 12.5k step --- app/menu.c | 7 ++++--- task/battery.c | 7 ++++++- ui/helper.c | 4 ++-- ui/menu.c | 7 ++++--- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/app/menu.c b/app/menu.c index 5491c8e1..18f87412 100644 --- a/app/menu.c +++ b/app/menu.c @@ -463,7 +463,7 @@ void MENU_AcceptSetting(void) break; case MENU_SCAN_RESUME: - gExtendedSettings.ScanResume = (gSettingCurrentValue + gSettingIndex) % gSettingMaxValues; + gExtendedSettings.ScanResume = ((gSettingCurrentValue + gSettingIndex) % gSettingMaxValues) + 1; SETTINGS_SaveGlobals(); break; @@ -825,8 +825,9 @@ void MENU_DrawSetting(void) break; case MENU_SCAN_RESUME: - gSettingCurrentValue = gExtendedSettings.ScanResume; + gSettingCurrentValue = gExtendedSettings.ScanResume - 1; gSettingMaxValues = 3; + DISPLAY_Fill(0, 159, 1, 55, COLOR_BACKGROUND); UI_DrawSettingScanResume(gSettingCurrentValue); break; @@ -1100,7 +1101,7 @@ void MENU_SettingKeyHandler(uint8_t Key) if (gMenuIndex == MENU_PERSONAL_ID || gMenuIndex == MENU_CH_NAME || gMenuIndex == MENU_CTCSS_DCS || gMenuIndex == MENU_RX_CTCSS_DCS || gMenuIndex == MENU_TX_CTCSS_DCS) { MENU_Redraw(true); } else { - MENU_Redraw(false); + MENU_Redraw(true); } if (Key == KEY_MENU) { BEEP_Play(740, 3, 80); diff --git a/task/battery.c b/task/battery.c index 087f76d2..4d634c5d 100644 --- a/task/battery.c +++ b/task/battery.c @@ -39,7 +39,12 @@ void Task_CheckBattery(void) gBatteryVoltage = BATTERY_GetVoltage(); - if (gRadioMode != RADIO_MODE_RX && VOX_Timer == 0 && gFM_Mode == FM_MODE_OFF && gScreenMode == SCREEN_MAIN && !gDTMF_InputMode) { + if (gRadioMode != RADIO_MODE_RX + && VOX_Timer == 0 + && gFM_Mode == FM_MODE_OFF + && gScreenMode == SCREEN_MAIN + && !gDTMF_InputMode + && !gFlashlightMode) { UI_DrawVoltage(!gSettings.CurrentVfo); } UI_DrawBattery(); diff --git a/ui/helper.c b/ui/helper.c index 5ade02fe..5c33a28b 100644 --- a/ui/helper.c +++ b/ui/helper.c @@ -431,12 +431,12 @@ void UI_DrawExtra(uint8_t Mode, uint8_t gModulationType, uint8_t Vfo) case 1: // TX mode gColorForeground = COLOR_RED; - UI_DrawSmallString(4, Y, "VO", 2); + UI_DrawSmallString(2, Y, " VO", 3); break; case 2: // RX mode gColorForeground = COLOR_BLUE; - UI_DrawSmallString(4, Y, "SQ", 2); + UI_DrawSmallString(2, Y, " SQ", 3); break; } } diff --git a/ui/menu.c b/ui/menu.c index 0a4a0796..c8754270 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -291,13 +291,14 @@ void UI_DrawTxPriority(void) void UI_DrawFrequencyStep(uint8_t Index) { - static const char Mode[14][5] = { + static const char Mode[15][5] = { "0.25K", "1.25K", "2.5K ", "5K ", "6.25K", "10K ", + "12.5K", "20K ", "25K ", "50K ", @@ -459,6 +460,6 @@ void UI_DrawSettingScanResume(uint8_t Index) "No Resume ", // 3 }; // Values start at 1 instead of 0 for this setting - UI_DrawSettingOption(Mode[Index - 1], 0); - UI_DrawSettingOption(Mode[(Index) % 3], 1); + UI_DrawSettingOption(Mode[Index], 0); + UI_DrawSettingOption(Mode[(Index + 1) % 3], 1); }