diff --git a/App/app/action.c b/App/app/action.c index 410ee518..fd53936f 100644 --- a/App/app/action.c +++ b/App/app/action.c @@ -503,17 +503,13 @@ void ACTION_RxMode(void) { static bool cycle = 0; - switch(cycle) { - case 0: - gEeprom.DUAL_WATCH = !gEeprom.DUAL_WATCH; - cycle = 1; - break; - case 1: - gEeprom.CROSS_BAND_RX_TX = !gEeprom.CROSS_BAND_RX_TX; - cycle = 0; - break; + if (cycle) { + gEeprom.CROSS_BAND_RX_TX = !gEeprom.CROSS_BAND_RX_TX; + } else { + gEeprom.DUAL_WATCH = !gEeprom.DUAL_WATCH; } + cycle = !cycle; ACTION_Update(); } @@ -523,22 +519,18 @@ void ACTION_MainOnly(void) static uint8_t dw = 0; static uint8_t cb = 0; - switch(cycle) { - case 0: - dw = gEeprom.DUAL_WATCH; - cb = gEeprom.CROSS_BAND_RX_TX; + if (cycle) { + gEeprom.DUAL_WATCH = dw; + gEeprom.CROSS_BAND_RX_TX = cb; + } else { + dw = gEeprom.DUAL_WATCH; + cb = gEeprom.CROSS_BAND_RX_TX; - gEeprom.DUAL_WATCH = 0; - gEeprom.CROSS_BAND_RX_TX = 0; - cycle = 1; - break; - case 1: - gEeprom.DUAL_WATCH = dw; - gEeprom.CROSS_BAND_RX_TX = cb; - cycle = 0; - break; + gEeprom.DUAL_WATCH = 0; + gEeprom.CROSS_BAND_RX_TX = 0; } + cycle = !cycle; ACTION_Update(); } diff --git a/App/app/aircopy.c b/App/app/aircopy.c index f5b42871..9d716d17 100644 --- a/App/app/aircopy.c +++ b/App/app/aircopy.c @@ -431,6 +431,10 @@ static void AIRCOPY_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Directio return; } + if (!gEeprom.SET_NAV) { + Direction = -Direction; + } + switch(Direction) { case 1: @@ -447,16 +451,7 @@ static void AIRCOPY_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Directio void AIRCOPY_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) { switch (Key) { - case KEY_0: - case KEY_1: - case KEY_2: - case KEY_3: - case KEY_4: - case KEY_5: - case KEY_6: - case KEY_7: - case KEY_8: - case KEY_9: + case KEY_0...KEY_9: AIRCOPY_Key_DIGITS(Key, bKeyPressed, bKeyHeld); break; case KEY_MENU: @@ -466,16 +461,8 @@ void AIRCOPY_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) AIRCOPY_Key_EXIT(bKeyPressed, bKeyHeld); break; case KEY_UP: - if(gEeprom.SET_NAV == 0) - AIRCOPY_Key_UP_DOWN(bKeyPressed, bKeyHeld, -1); - else - AIRCOPY_Key_UP_DOWN(bKeyPressed, bKeyHeld, 1); - break; case KEY_DOWN: - if(gEeprom.SET_NAV == 0) - AIRCOPY_Key_UP_DOWN(bKeyPressed, bKeyHeld, 1); - else - AIRCOPY_Key_UP_DOWN(bKeyPressed, bKeyHeld, -1); + AIRCOPY_Key_UP_DOWN(bKeyPressed, bKeyHeld, Key == KEY_UP ? 1 : -1); break; default: break; diff --git a/App/app/app.c b/App/app/app.c index dcdb016b..ba58eb13 100644 --- a/App/app/app.c +++ b/App/app/app.c @@ -273,18 +273,9 @@ static void HandleReceive(void) break; case CODE_TYPE_CONTINUOUS_TONE: - if (gFoundCTCSS && gFoundCTCSSCountdown_10ms == 0) - { - gFoundCTCSS = false; - gFoundCDCSS = false; - Mode = END_OF_RX_MODE_END; - goto Skip; - } - break; - case CODE_TYPE_DIGITAL: case CODE_TYPE_REVERSE_DIGITAL: - if (gFoundCDCSS && gFoundCDCSSCountdown_10ms == 0) + if ((gFoundCTCSS && gFoundCTCSSCountdown_10ms == 0) || (gFoundCDCSS && gFoundCDCSSCountdown_10ms == 0)) { gFoundCTCSS = false; gFoundCDCSS = false; @@ -1133,14 +1124,7 @@ void APP_Update(void) // go back to sleep #ifdef ENABLE_FEAT_F4HWN_SLEEP - if(gWakeUp) - { - gPowerSave_10ms = gEeprom.BATTERY_SAVE * 200; // deep sleep now indexed on BatSav - } - else - { - gPowerSave_10ms = gEeprom.BATTERY_SAVE * 10; - } + gPowerSave_10ms = gEeprom.BATTERY_SAVE * (gWakeUp ? 200 : 10); // deep sleep now indexed on BatSav #else gPowerSave_10ms = gEeprom.BATTERY_SAVE * 10; #endif @@ -2124,18 +2108,14 @@ static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) } #endif } + else if (gScreenToDisplay != DISPLAY_INVALID && ( + (Key != KEY_SIDE1 && Key != KEY_SIDE2) #ifdef ENABLE_FEAT_F4HWN // For F + SIDE1 or F + SIDE2 - else if (gWasFKeyPressed && (Key == KEY_SIDE1 || Key == KEY_SIDE2)) { - ProcessKeysFunctions[gScreenToDisplay](Key, bKeyPressed, bKeyHeld); - } - else if (Key != KEY_SIDE1 && Key != KEY_SIDE2 && gScreenToDisplay != DISPLAY_INVALID) { - ProcessKeysFunctions[gScreenToDisplay](Key, bKeyPressed, bKeyHeld); - } -#else - else if (Key != KEY_SIDE1 && Key != KEY_SIDE2 && gScreenToDisplay != DISPLAY_INVALID) { - ProcessKeysFunctions[gScreenToDisplay](Key, bKeyPressed, bKeyHeld); - } + || (gWasFKeyPressed && (Key == KEY_SIDE1 || Key == KEY_SIDE2)) #endif + )) { + ProcessKeysFunctions[gScreenToDisplay](Key, bKeyPressed, bKeyHeld); + } else if (!SCANNER_IsScanning() #ifdef ENABLE_AIRCOPY && gScreenToDisplay != DISPLAY_AIRCOPY diff --git a/App/app/breakout.c b/App/app/breakout.c index 3e1ff4e9..72cae521 100644 --- a/App/app/breakout.c +++ b/App/app/breakout.c @@ -426,15 +426,7 @@ static bool HandleUserInput() if (kbd.current != KEY_INVALID && kbd.current == kbd.prev) { kbd.counter = 1; - } - else - { - kbd.counter = 0; - } - - // Process the key if counter indicates it should be handled - if (kbd.counter == 1) - { + OnKeyDown(kbd.current); // Special handling for MENU key @@ -444,6 +436,10 @@ static bool HandleUserInput() SYSTEM_DelayMs(250); } } + else + { + kbd.counter = 0; + } return true; } diff --git a/App/app/fm.c b/App/app/fm.c index ed4882b2..93831a8b 100644 --- a/App/app/fm.c +++ b/App/app/fm.c @@ -501,6 +501,10 @@ static void Key_UP_DOWN(uint8_t state, int8_t Step) return; } + if (!gEeprom.SET_NAV) { + Step = -Step; + } + if (gAskToSave) { gRequestDisplayScreen = DISPLAY_FM; gFM_ChannelPosition = NUMBER_AddWithWraparound(gFM_ChannelPosition, Step, 0, FM_CHANNELS_MAX - 1); @@ -561,16 +565,8 @@ void FM_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) Key_MENU(state); break; case KEY_UP: - if(gEeprom.SET_NAV == 0) - Key_UP_DOWN(state, -1); - else - Key_UP_DOWN(state, 1); - break; case KEY_DOWN: - if(gEeprom.SET_NAV == 0) - Key_UP_DOWN(state, 1); - else - Key_UP_DOWN(state, -1); + Key_UP_DOWN(state, Key == KEY_UP ? 1 : -1); break; case KEY_EXIT: Key_EXIT(state); diff --git a/App/app/main.c b/App/app/main.c index a1cfa934..ddacafbb 100644 --- a/App/app/main.c +++ b/App/app/main.c @@ -76,18 +76,18 @@ static void toggle_chan_scanlist(void) { att->exclude = false; return; - } + } - uint8_t scanlist = gTxVfo->SCANLIST_PARTICIPATION; + uint8_t scanlist = gTxVfo->SCANLIST_PARTICIPATION; - scanlist++; + scanlist++; - if (scanlist > MR_CHANNELS_LIST + 1) - scanlist = 0; + if (scanlist > MR_CHANNELS_LIST + 1) + scanlist = 0; - gTxVfo->SCANLIST_PARTICIPATION = scanlist; + gTxVfo->SCANLIST_PARTICIPATION = scanlist; - SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true, true); + SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true, true); gVfoConfigureMode = VFO_CONFIGURE; gFlagResetVfos = true; @@ -291,13 +291,13 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep) case KEY_UP: case KEY_DOWN: { - int8_t direction = (Key == KEY_UP) ? 1 : -1; + bool isKeyUp = (Key == KEY_UP); if (gScanStateDir != SCAN_OFF) { - RADIO_NextValidList(direction); + RADIO_NextValidList(isKeyUp ? 1 : -1); } else { // Adjust squelch: UP increments, DOWN decrements - if (direction > 0) { + if (isKeyUp) { gEeprom.SQUELCH_LEVEL = (gEeprom.SQUELCH_LEVEL < 9) ? gEeprom.SQUELCH_LEVEL + 1 : 9; } else { gEeprom.SQUELCH_LEVEL = (gEeprom.SQUELCH_LEVEL > 0) ? gEeprom.SQUELCH_LEVEL - 1 : 0; @@ -309,30 +309,23 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep) } break; case KEY_SIDE1: - uint8_t a = FREQUENCY_GetSortedIdxFromStepIdx(gTxVfo->STEP_SETTING); - if (a < STEP_N_ELEM - 1) - { - gTxVfo->STEP_SETTING = FREQUENCY_GetStepIdxFromSortedIdx(a + 1); - } - if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE)) - { - gRequestSaveChannel = 1; - } - gVfoConfigureMode = VFO_CONFIGURE; - gWasFKeyPressed = false; - break; case KEY_SIDE2: - uint8_t b = FREQUENCY_GetSortedIdxFromStepIdx(gTxVfo->STEP_SETTING); - if (b > 0) { - gTxVfo->STEP_SETTING = FREQUENCY_GetStepIdxFromSortedIdx(b - 1); + bool isKeySide1 = (Key == KEY_SIDE1); + uint8_t idx = FREQUENCY_GetSortedIdxFromStepIdx(gTxVfo->STEP_SETTING); + + if ((isKeySide1 && idx < STEP_N_ELEM - 1) || (!isKeySide1 && idx > 0)) + { + gTxVfo->STEP_SETTING = FREQUENCY_GetStepIdxFromSortedIdx(idx + (isKeySide1 ? 1 : -1)); + + if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE)) { + gRequestSaveChannel = 1; + } + gVfoConfigureMode = VFO_CONFIGURE; + } + + gWasFKeyPressed = false; } - if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE)) - { - gRequestSaveChannel = 1; - } - gVfoConfigureMode = VFO_CONFIGURE; - gWasFKeyPressed = false; break; #endif @@ -493,15 +486,15 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) if (RADIO_CheckValidList(value)) { /* Requested scan list is valid */ - gEeprom.SCAN_LIST_DEFAULT = value; + gEeprom.SCAN_LIST_DEFAULT = value; } else - { - /* Requested scan list is empty or invalid: - jump to the next valid scan list */ + { + /* Requested scan list is empty or invalid: + jump to the next valid scan list */ gEeprom.SCAN_LIST_DEFAULT = value; - RADIO_NextValidList(1); - } + RADIO_NextValidList(1); + } #ifdef ENABLE_FEAT_F4HWN_RESUME_STATE SETTINGS_WriteCurrentState(); @@ -826,7 +819,6 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld) gRequestDisplayScreen = DISPLAY_MAIN; } - gWasFKeyPressed = false; gUpdateStatus = true; ACTION_Handle(KEY_MENU, bKeyPressed, bKeyHeld); @@ -963,18 +955,13 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld) static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction) { + if (!gEeprom.SET_NAV) { + Direction = -Direction; + } #ifdef ENABLE_FEAT_F4HWN // Set Squelch F + UP or Down if(gWasFKeyPressed) { - switch(Direction) - { - case 1: - processFKeyFunction(KEY_UP, false); - break; - case -1: - processFKeyFunction(KEY_DOWN, false); - break; - } + processFKeyFunction(Direction == 1 ? KEY_UP : KEY_DOWN, false); return; } #endif @@ -1102,16 +1089,8 @@ void MAIN_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) MAIN_Key_MENU(bKeyPressed, bKeyHeld); break; case KEY_UP: - if(gEeprom.SET_NAV == 0) - MAIN_Key_UP_DOWN(bKeyPressed, bKeyHeld, -1); - else - MAIN_Key_UP_DOWN(bKeyPressed, bKeyHeld, 1); - break; case KEY_DOWN: - if(gEeprom.SET_NAV == 0) - MAIN_Key_UP_DOWN(bKeyPressed, bKeyHeld, 1); - else - MAIN_Key_UP_DOWN(bKeyPressed, bKeyHeld, -1); + MAIN_Key_UP_DOWN(bKeyPressed, bKeyHeld, Key == KEY_UP ? 1 : -1); break; case KEY_EXIT: MAIN_Key_EXIT(bKeyPressed, bKeyHeld); diff --git a/App/app/menu.c b/App/app/menu.c index 13eba652..9c307ef0 100644 --- a/App/app/menu.c +++ b/App/app/menu.c @@ -1874,6 +1874,10 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction) uint16_t Channel; bool bCheckScanList; + if (!gEeprom.SET_NAV && gIsInSubMenu) { + Direction = -Direction; + } + if (UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME && gIsInSubMenu && edit_index >= 0) { // change the character if (bKeyPressed && edit_index < 10 && Direction != 0) @@ -2014,42 +2018,15 @@ void MENU_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) { switch (Key) { - case KEY_0: - case KEY_1: - case KEY_2: - case KEY_3: - case KEY_4: - case KEY_5: - case KEY_6: - case KEY_7: - case KEY_8: - case KEY_9: + case KEY_0...KEY_9: MENU_Key_0_to_9(Key, bKeyPressed, bKeyHeld); break; case KEY_MENU: MENU_Key_MENU(bKeyPressed, bKeyHeld); break; case KEY_UP: - if(gEeprom.SET_NAV == 0) { - if(gIsInSubMenu) - MENU_Key_UP_DOWN(bKeyPressed, bKeyHeld, -1); - else - MENU_Key_UP_DOWN(bKeyPressed, bKeyHeld, 1); - } - else { - MENU_Key_UP_DOWN(bKeyPressed, bKeyHeld, 1); - } - break; case KEY_DOWN: - if(gEeprom.SET_NAV == 0) { - if(gIsInSubMenu) - MENU_Key_UP_DOWN(bKeyPressed, bKeyHeld, 1); - else - MENU_Key_UP_DOWN(bKeyPressed, bKeyHeld, -1); - } - else { - MENU_Key_UP_DOWN(bKeyPressed, bKeyHeld, -1); - } + MENU_Key_UP_DOWN(bKeyPressed, bKeyHeld, Key == KEY_UP ? 1 : -1); break; case KEY_EXIT: MENU_Key_EXIT(bKeyPressed, bKeyHeld); diff --git a/App/app/scanner.c b/App/app/scanner.c index 85fdb434..b023ec44 100644 --- a/App/app/scanner.c +++ b/App/app/scanner.c @@ -257,6 +257,10 @@ static void SCANNER_Key_UP_DOWN(bool bKeyPressed, bool pKeyHeld, int8_t Directio gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL; } + if (!gEeprom.SET_NAV) { + Direction = -Direction; + } + if (gScannerSaveState == SCAN_SAVE_CHAN_SEL) { gScanChannel = NUMBER_AddWithWraparound(gScanChannel, Direction, 0, MR_CHANNEL_LAST); gShowChPrefix = RADIO_CheckValidChannel(gScanChannel, false, 0); @@ -276,16 +280,8 @@ void SCANNER_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) SCANNER_Key_MENU(bKeyPressed, bKeyHeld); break; case KEY_UP: - if(gEeprom.SET_NAV == 0) - SCANNER_Key_UP_DOWN(bKeyPressed, bKeyHeld, -1); - else - SCANNER_Key_UP_DOWN(bKeyPressed, bKeyHeld, 1); - break; case KEY_DOWN: - if(gEeprom.SET_NAV == 0) - SCANNER_Key_UP_DOWN(bKeyPressed, bKeyHeld, 1); - else - SCANNER_Key_UP_DOWN(bKeyPressed, bKeyHeld, -1); + SCANNER_Key_UP_DOWN(bKeyPressed, bKeyHeld, Key == KEY_UP ? 1 : -1); break; case KEY_EXIT: SCANNER_Key_EXIT(bKeyPressed, bKeyHeld); diff --git a/App/app/spectrum.c b/App/app/spectrum.c index a5d00510..b8e3b996 100644 --- a/App/app/spectrum.c +++ b/App/app/spectrum.c @@ -1185,37 +1185,32 @@ static void DrawArrow(uint8_t x) static void OnKeyDown(uint8_t key) { - bool nav = (gEeprom.SET_NAV != 0); + bool nav = gEeprom.SET_NAV; + bool isTrue = false; switch (key) { case KEY_3: - UpdateDBMax(true); - break; + isTrue = true; + [[fallthrough]]; case KEY_9: - UpdateDBMax(false); + UpdateDBMax(isTrue); break; case KEY_1: - UpdateScanStep(true); - break; + isTrue = true; + [[fallthrough]]; case KEY_7: - UpdateScanStep(false); + UpdateScanStep(isTrue); break; case KEY_2: - UpdateFreqChangeStep(true); - break; + isTrue = true; + [[fallthrough]]; case KEY_8: - UpdateFreqChangeStep(false); + UpdateFreqChangeStep(isTrue); break; case KEY_UP: -#ifdef ENABLE_SCAN_RANGES - if (!gScanRangeStart) { -#endif - UpdateCurrentFreq(nav); -#ifdef ENABLE_SCAN_RANGES - } -#endif - break; + nav = !nav; + [[fallthrough]]; case KEY_DOWN: #ifdef ENABLE_SCAN_RANGES if (!gScanRangeStart) { @@ -1229,10 +1224,10 @@ static void OnKeyDown(uint8_t key) Blacklist(); break; case KEY_STAR: - UpdateRssiTriggerLevel(true); - break; + isTrue = true; + [[fallthrough]]; case KEY_F: - UpdateRssiTriggerLevel(false); + UpdateRssiTriggerLevel(isTrue); break; case KEY_5: #ifdef ENABLE_SCAN_RANGES @@ -1285,21 +1280,10 @@ static void OnKeyDownFreqInput(uint8_t key) { switch (key) { - case KEY_0: - case KEY_1: - case KEY_2: - case KEY_3: - case KEY_4: - case KEY_5: - case KEY_6: - case KEY_7: - case KEY_8: - case KEY_9: + case KEY_0...KEY_9: case KEY_STAR: - UpdateFreqInput(key); - break; case KEY_EXIT: - if (freqInputIndex == 0) + if (freqInputIndex == 0 && key == KEY_EXIT) { SetState(previousState); break; @@ -1330,23 +1314,20 @@ static void OnKeyDownFreqInput(uint8_t key) void OnKeyDownStill(KEY_Code_t key) { - bool nav = (gEeprom.SET_NAV != 0); + bool nav = gEeprom.SET_NAV; + bool isTrue = false; switch (key) { case KEY_3: - UpdateDBMax(true); - break; + isTrue = true; + [[fallthrough]]; case KEY_9: - UpdateDBMax(false); + UpdateDBMax(isTrue); break; case KEY_UP: - if (menuState) { - SetRegMenuValue(menuState, nav); - break; - } - UpdateCurrentFreqStill(nav); - break; + nav = !nav; + [[fallthrough]]; case KEY_DOWN: if (menuState) { SetRegMenuValue(menuState, !nav); @@ -1355,10 +1336,10 @@ void OnKeyDownStill(KEY_Code_t key) UpdateCurrentFreqStill(!nav); break; case KEY_STAR: - UpdateRssiTriggerLevel(true); - break; + isTrue = true; + [[fallthrough]]; case KEY_F: - UpdateRssiTriggerLevel(false); + UpdateRssiTriggerLevel(isTrue); break; case KEY_5: FreqInput(); @@ -1381,14 +1362,7 @@ void OnKeyDownStill(KEY_Code_t key) BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, true); */ break; case KEY_MENU: - if (menuState == ARRAY_SIZE(registerSpecs) - 1) - { - menuState = 1; - } - else - { - menuState++; - } + menuState = (menuState == ARRAY_SIZE(registerSpecs) - 1) ? 1 : menuState + 1; redrawScreen = true; break; case KEY_EXIT: diff --git a/App/functions.c b/App/functions.c index ef580fc7..e68e6723 100644 --- a/App/functions.c +++ b/App/functions.c @@ -118,14 +118,7 @@ void FUNCTION_Foreground(const FUNCTION_Type_t PreviousFunction) void FUNCTION_PowerSave() { #ifdef ENABLE_FEAT_F4HWN_SLEEP - if(gWakeUp) - { - gPowerSave_10ms = gEeprom.BATTERY_SAVE * 200; // deep sleep now indexed on BatSav - } - else - { - gPowerSave_10ms = gEeprom.BATTERY_SAVE * 10; - } + gPowerSave_10ms = gEeprom.BATTERY_SAVE * (gWakeUp ? 200 : 10); // deep sleep now indexed on BatSav #else gPowerSave_10ms = gEeprom.BATTERY_SAVE * 10; #endif diff --git a/App/ui/main.c b/App/ui/main.c index 44a2a537..931387af 100644 --- a/App/ui/main.c +++ b/App/ui/main.c @@ -46,7 +46,7 @@ center_line_t center_line = CENTER_LINE_NONE; #ifdef ENABLE_FEAT_F4HWN - static int8_t RxBlink; + // static int8_t RxBlink; static int8_t RxBlinkLed = 0; static int8_t RxBlinkLedCounter; static int8_t RxLine; @@ -770,37 +770,37 @@ void UI_DisplayMain(void) //if (FUNCTION_IsRx() && gEeprom.RX_VFO == vfo_num) { if (FUNCTION_IsRx() && gEeprom.RX_VFO == vfo_num && VfoState[vfo_num] == VFO_STATE_NORMAL) { #ifdef ENABLE_FEAT_F4HWN - RxBlinkLed = 1; - RxBlinkLedCounter = 0; - RxLine = line; - RxOnVfofrequency = frequency; - if(!isMainVFO) - { - RxBlink = 1; - } - else - { - RxBlink = 0; - } + RxBlinkLed = 1; + RxBlinkLedCounter = 0; + RxLine = line; + RxOnVfofrequency = frequency; + // if(!isMainVFO) + // { + // RxBlink = 1; + // } + // else + // { + // RxBlink = 0; + // } - if (RxBlink == 0 || RxBlink == 1) { - if(gRxVfo->Modulation == MODULATION_AM) - GUI_DisplaySmallest("AIR", 10, RxLine == 0 ? 1 : 33, false, true); - else { - #ifdef ENABLE_FEAT_F4HWN_AUDIO - strcpy(String, gSubMenu_SET_AUD[gSetting_set_audio]); - #else - strcpy(String, "RX"); - #endif - GUI_DisplaySmallest(String, 10, RxLine == 0 ? 1 : 33, false, true); - } + // if (RxBlink == 0 || RxBlink == 1) { + if(gRxVfo->Modulation == MODULATION_AM) + GUI_DisplaySmallest("AIR", 10, RxLine == 0 ? 1 : 33, false, true); + else { + #ifdef ENABLE_FEAT_F4HWN_AUDIO + strcpy(String, gSubMenu_SET_AUD[gSetting_set_audio]); + #else + strcpy(String, "RX"); + #endif + GUI_DisplaySmallest(String, 10, RxLine == 0 ? 1 : 33, false, true); + } - //UI_PrintStringSmallBold("RX", 8, 0, RxLine); - } + //UI_PrintStringSmallBold("RX", 8, 0, RxLine); + // } #else - UI_PrintStringSmallBold("RX", 8, 0, line); + UI_PrintStringSmallBold("RX", 8, 0, line); #endif - } + } #ifdef ENABLE_FEAT_F4HWN else { diff --git a/App/ui/menu.c b/App/ui/menu.c index 5edaa315..827a30cc 100644 --- a/App/ui/menu.c +++ b/App/ui/menu.c @@ -703,15 +703,14 @@ void UI_DisplayMenu(void) if (!gIsInSubMenu || gInputBoxIndex == 0) { sprintf(String, "%3d.%05u", gSubMenuSelection / 100000, abs(gSubMenuSelection) % 100000); - UI_PrintString(String, menu_item_x1, menu_item_x2, 1, 8); } else { const char * ascii = INPUTBOX_GetAscii(); sprintf(String, "%.3s.%.3s ",ascii, ascii + 3); - UI_PrintString(String, menu_item_x1, menu_item_x2, 1, 8); } + UI_PrintString(String, menu_item_x1, menu_item_x2, 1, 8); UI_PrintString("MHz", menu_item_x1, menu_item_x2, 3, 8); already_printed = true;