Skip to content

Commit

Permalink
READ MANUAL prompt for unlocking TX
Browse files Browse the repository at this point in the history
  • Loading branch information
egzumer committed Nov 9, 2023
1 parent d7b6cdf commit a43a3f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
9 changes: 5 additions & 4 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#endif

uint8_t gUnlockAllTxConfCnt;

#ifdef ENABLE_F_CAL_MENU
void writeXtalFreqCal(const int32_t value, const bool update_eeprom)
{
Expand Down Expand Up @@ -759,14 +761,13 @@ void MENU_AcceptSetting(void)
break;

case MENU_F_LOCK: {
static uint8_t cnt;
if(gSubMenuSelection == F_LOCK_NONE) { // select 10 times to enable
cnt++;
if(cnt < 10)
gUnlockAllTxConfCnt++;
if(gUnlockAllTxConfCnt < 10)
return;
}
else
cnt = 0;
gUnlockAllTxConfCnt = 0;

gSetting_F_LOCK = gSubMenuSelection;
break;
Expand Down
2 changes: 2 additions & 0 deletions app/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
void writeXtalFreqCal(const int32_t value, const bool update_eeprom);
#endif

extern uint8_t gUnlockAllTxConfCnt;

int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax);
void MENU_AcceptSetting(void);
void MENU_ShowCurrentSetting(void);
Expand Down
5 changes: 4 additions & 1 deletion ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,10 @@ void UI_DisplayMenu(void)
break;

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;

#ifdef ENABLE_F_CAL_MENU
Expand Down

0 comments on commit a43a3f9

Please sign in to comment.