Merge remote-tracking branch 'remotes/OneOfEleven/main'

This commit is contained in:
Krzysiek Egzmont
2023-10-02 23:15:34 +02:00
28 changed files with 584 additions and 576 deletions

View File

@@ -315,14 +315,16 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
*pMax = 16;
break;
case MENU_F_CALI:
*pMin = -50;
*pMax = +50;
break;
#ifdef ENABLE_F_CAL_MENU
case MENU_F_CALI:
*pMin = -50;
*pMax = +50;
break;
#endif
case MENU_BATCAL:
*pMin = 1760; // 0
*pMax = 2000; // 2300
*pMin = 1600; // 0
*pMax = 2200; // 2300
break;
default:
@@ -736,10 +738,11 @@ void MENU_AcceptSetting(void)
gSetting_TX_EN = gSubMenuSelection;
break;
case MENU_F_CALI:
//if (gF_LOCK)
#ifdef ENABLE_F_CAL_MENU
case MENU_F_CALI:
writeXtalFreqCal(gSubMenuSelection);
return;
return;
#endif
case MENU_BATCAL:
gBatteryCalibration[3] = gSubMenuSelection;
@@ -1106,9 +1109,11 @@ void MENU_ShowCurrentSetting(void)
gSubMenuSelection = gSetting_TX_EN;
break;
case MENU_F_CALI:
gSubMenuSelection = gEeprom.BK4819_XTAL_FREQ_LOW;
break;
#ifdef ENABLE_F_CAL_MENU
case MENU_F_CALI:
gSubMenuSelection = gEeprom.BK4819_XTAL_FREQ_LOW;
break;
#endif
case MENU_BATCAL:
gSubMenuSelection = gBatteryCalibration[3];
@@ -1117,12 +1122,6 @@ void MENU_ShowCurrentSetting(void)
default:
return;
}
// if (gFlagBackupSetting)
{ // save a copy incase the user wants to back out
// gFlagBackupSetting = false;
gSubMenuSelection_original = gSubMenuSelection;
}
}
static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
@@ -1176,7 +1175,6 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
gMenuCursor = Value - 1;
gFlagRefreshSetting = true;
gFlagBackupSetting = true;
return;
}
@@ -1192,7 +1190,6 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
gMenuCursor = Value - 1;
gFlagRefreshSetting = true;
gFlagBackupSetting = true;
return;
}
break;
@@ -1301,17 +1298,6 @@ static void MENU_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
{
if (gIsInSubMenu)
{
// ***********************
// restore original value
if (gMenuCursor == MENU_F_CALI)
{
// if (gF_LOCK)
// writeXtalFreqCal(gSubMenuSelection_original);
}
// ***********************
if (gInputBoxIndex == 0 || gMenuCursor != MENU_OFFSET)
{
gAskForConfirmation = 0;
@@ -1616,7 +1602,6 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
gMenuCursor = NUMBER_AddWithWraparound(gMenuCursor, -Direction, 0, gMenuListCount - 1);
gFlagRefreshSetting = true;
gFlagBackupSetting = true;
gRequestDisplayScreen = DISPLAY_MENU;
@@ -1736,6 +1721,19 @@ void MENU_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
break;
}
if (gScreenToDisplay == DISPLAY_MENU && gMenuCursor == MENU_VOL)
gVoltageMenuCountdown = menu_timeout_500ms;
if (gScreenToDisplay == DISPLAY_MENU)
{
if (gMenuCursor == MENU_VOL ||
#ifdef ENABLE_F_CAL_MENU
gMenuCursor == MENU_F_CALI ||
#endif
gMenuCursor == MENU_BATCAL)
{
gMenuCountdown = menu_timeout_long_500ms;
}
else
{
gMenuCountdown = menu_timeout_500ms;
}
}
}