Skip to content

Commit a43a3f9

Browse files
committed
READ MANUAL prompt for unlocking TX
1 parent d7b6cdf commit a43a3f9

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

app/menu.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
4848
#endif
4949

50+
uint8_t gUnlockAllTxConfCnt;
51+
5052
#ifdef ENABLE_F_CAL_MENU
5153
void writeXtalFreqCal(const int32_t value, const bool update_eeprom)
5254
{
@@ -759,14 +761,13 @@ void MENU_AcceptSetting(void)
759761
break;
760762

761763
case MENU_F_LOCK: {
762-
static uint8_t cnt;
763764
if(gSubMenuSelection == F_LOCK_NONE) { // select 10 times to enable
764-
cnt++;
765-
if(cnt < 10)
765+
gUnlockAllTxConfCnt++;
766+
if(gUnlockAllTxConfCnt < 10)
766767
return;
767768
}
768769
else
769-
cnt = 0;
770+
gUnlockAllTxConfCnt = 0;
770771

771772
gSetting_F_LOCK = gSubMenuSelection;
772773
break;

app/menu.h

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
void writeXtalFreqCal(const int32_t value, const bool update_eeprom);
2424
#endif
2525

26+
extern uint8_t gUnlockAllTxConfCnt;
27+
2628
int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax);
2729
void MENU_AcceptSetting(void);
2830
void MENU_ShowCurrentSetting(void);

ui/menu.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,10 @@ void UI_DisplayMenu(void)
802802
break;
803803

804804
case MENU_F_LOCK:
805-
strcpy(String, gSubMenu_F_LOCK[gSubMenuSelection]);
805+
if(!gIsInSubMenu && gUnlockAllTxConfCnt>0 && gUnlockAllTxConfCnt<10)
806+
strcpy(String, "READ\nMANUAL");
807+
else
808+
strcpy(String, gSubMenu_F_LOCK[gSubMenuSelection]);
806809
break;
807810

808811
#ifdef ENABLE_F_CAL_MENU

0 commit comments

Comments
 (0)