READ MANUAL prompt for unlocking TX

This commit is contained in:
Krzysiek Egzmont
2023-11-09 10:33:28 +01:00
parent d7b6cdf444
commit a43a3f949f
3 changed files with 11 additions and 5 deletions

View File

@@ -47,6 +47,8 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#endif #endif
uint8_t gUnlockAllTxConfCnt;
#ifdef ENABLE_F_CAL_MENU #ifdef ENABLE_F_CAL_MENU
void writeXtalFreqCal(const int32_t value, const bool update_eeprom) void writeXtalFreqCal(const int32_t value, const bool update_eeprom)
{ {
@@ -759,14 +761,13 @@ void MENU_AcceptSetting(void)
break; break;
case MENU_F_LOCK: { case MENU_F_LOCK: {
static uint8_t cnt;
if(gSubMenuSelection == F_LOCK_NONE) { // select 10 times to enable if(gSubMenuSelection == F_LOCK_NONE) { // select 10 times to enable
cnt++; gUnlockAllTxConfCnt++;
if(cnt < 10) if(gUnlockAllTxConfCnt < 10)
return; return;
} }
else else
cnt = 0; gUnlockAllTxConfCnt = 0;
gSetting_F_LOCK = gSubMenuSelection; gSetting_F_LOCK = gSubMenuSelection;
break; break;

View File

@@ -23,6 +23,8 @@
void writeXtalFreqCal(const int32_t value, const bool update_eeprom); void writeXtalFreqCal(const int32_t value, const bool update_eeprom);
#endif #endif
extern uint8_t gUnlockAllTxConfCnt;
int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax); int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax);
void MENU_AcceptSetting(void); void MENU_AcceptSetting(void);
void MENU_ShowCurrentSetting(void); void MENU_ShowCurrentSetting(void);

View File

@@ -802,7 +802,10 @@ void UI_DisplayMenu(void)
break; break;
case MENU_F_LOCK: case MENU_F_LOCK:
strcpy(String, gSubMenu_F_LOCK[gSubMenuSelection]); if(!gIsInSubMenu && gUnlockAllTxConfCnt>0 && gUnlockAllTxConfCnt<10)
strcpy(String, "READ\nMANUAL");
else
strcpy(String, gSubMenu_F_LOCK[gSubMenuSelection]);
break; break;
#ifdef ENABLE_F_CAL_MENU #ifdef ENABLE_F_CAL_MENU