Merge pull request #182 from mrkusypl/v5_refactor

Major code optimization (456 bytes saved)
This commit is contained in:
Armel FAUVEAU authored and GitHub committed 2026-03-05 00:11:51 +01:00
commit afb317d12a
12 files changed
+143 -274

No files matched your search

+14 -22
View File
@@ -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();
}
+6 -19
View File
@@ -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;
+8 -28
View File
@@ -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
+5 -9
View File
@@ -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;
}
+5 -9
View File
@@ -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);
+35 -56
View File
@@ -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);
+6 -29
View File
@@ -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);
+5 -9
View File
@@ -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);
+29 -55
View File
@@ -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:
+1 -8
View File
@@ -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
+28 -28
View File
@@ -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
{
+1 -2
View File
@@ -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;