Improve KeyLck (0 to 10min)

This commit is contained in:
Armel FAUVEAU
2024-10-09 01:29:13 +02:00
parent 5478cc05ac
commit 31c17fa2ac
5 changed files with 12 additions and 6 deletions

View File

@@ -1834,7 +1834,7 @@ static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gBatterySaveCountdown_10ms = battery_save_count_10ms; gBatterySaveCountdown_10ms = battery_save_count_10ms;
if (gEeprom.AUTO_KEYPAD_LOCK) if (gEeprom.AUTO_KEYPAD_LOCK)
gKeyLockCountdown = 30; // 15 seconds gKeyLockCountdown = gEeprom.AUTO_KEYPAD_LOCK * 30; // 15 seconds step
if (!bKeyPressed) { // key released if (!bKeyPressed) { // key released
if (flagSaveVfo) { if (flagSaveVfo) {

View File

@@ -235,7 +235,6 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
#endif #endif
case MENU_BCL: case MENU_BCL:
case MENU_BEEP: case MENU_BEEP:
case MENU_AUTOLK:
case MENU_S_ADD1: case MENU_S_ADD1:
case MENU_S_ADD2: case MENU_S_ADD2:
case MENU_S_ADD3: case MENU_S_ADD3:
@@ -275,6 +274,10 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
break; break;
#endif #endif
case MENU_AUTOLK:
*pMax = 40;
break;
case MENU_TOT: case MENU_TOT:
//*pMin = 0; //*pMin = 0;
*pMin = 5; *pMin = 5;
@@ -634,7 +637,7 @@ void MENU_AcceptSetting(void)
case MENU_AUTOLK: case MENU_AUTOLK:
gEeprom.AUTO_KEYPAD_LOCK = gSubMenuSelection; gEeprom.AUTO_KEYPAD_LOCK = gSubMenuSelection;
gKeyLockCountdown = 30; gKeyLockCountdown = gEeprom.AUTO_KEYPAD_LOCK * 30; // 15 seconds step
break; break;
case MENU_S_ADD1: case MENU_S_ADD1:

View File

@@ -120,7 +120,7 @@ void SETTINGS_InitEEPROM(void)
gEeprom.KEY_2_SHORT_PRESS_ACTION = (Data[3] < ACTION_OPT_LEN) ? Data[3] : ACTION_OPT_SCAN; gEeprom.KEY_2_SHORT_PRESS_ACTION = (Data[3] < ACTION_OPT_LEN) ? Data[3] : ACTION_OPT_SCAN;
gEeprom.KEY_2_LONG_PRESS_ACTION = (Data[4] < ACTION_OPT_LEN) ? Data[4] : ACTION_OPT_NONE; gEeprom.KEY_2_LONG_PRESS_ACTION = (Data[4] < ACTION_OPT_LEN) ? Data[4] : ACTION_OPT_NONE;
gEeprom.SCAN_RESUME_MODE = (Data[5] < 105) ? Data[5] : 14; gEeprom.SCAN_RESUME_MODE = (Data[5] < 105) ? Data[5] : 14;
gEeprom.AUTO_KEYPAD_LOCK = (Data[6] < 2) ? Data[6] : false; gEeprom.AUTO_KEYPAD_LOCK = (Data[6] < 41) ? Data[6] : 0;
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 6) ? Data[7] : POWER_ON_DISPLAY_MODE_VOLTAGE; gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 6) ? Data[7] : POWER_ON_DISPLAY_MODE_VOLTAGE;
#else #else

View File

@@ -211,7 +211,7 @@ typedef struct {
uint8_t field37_0x32; uint8_t field37_0x32;
uint8_t field38_0x33; uint8_t field38_0x33;
bool AUTO_KEYPAD_LOCK; uint8_t AUTO_KEYPAD_LOCK;
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750) #if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
ALARM_Mode_t ALARM_MODE; ALARM_Mode_t ALARM_MODE;
#endif #endif

View File

@@ -705,7 +705,10 @@ void UI_DisplayMenu(void)
break; break;
case MENU_AUTOLK: case MENU_AUTOLK:
strcpy(String, (gSubMenuSelection == 0) ? "OFF" : "AUTO"); if (gSubMenuSelection == 0)
strcpy(String, "OFF");
else
sprintf(String, "%02dm:%02ds", ((gSubMenuSelection * 15) / 60), ((gSubMenuSelection * 15) % 60));
break; break;
case MENU_COMPAND: case MENU_COMPAND: