Add SetLck

This commit is contained in:
Armel FAUVEAU
2024-02-11 03:47:31 +01:00
parent 2307976c17
commit d6a57be4c4
8 changed files with 46 additions and 1 deletions

View File

@@ -1756,7 +1756,14 @@ static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
bool lowBatPopup = gLowBattery && !gLowBatteryConfirmed && gScreenToDisplay == DISPLAY_MAIN;
#ifdef ENABLE_FEAT_F4HWN // Disable PTT if KEY_LOCK
if ((gEeprom.KEY_LOCK || lowBatPopup) && gCurrentFunction != FUNCTION_TRANSMIT)
bool lck_condition = false;
if(gSetting_set_lck)
lck_condition = (gEeprom.KEY_LOCK || lowBatPopup) && gCurrentFunction != FUNCTION_TRANSMIT;
else
lck_condition = (gEeprom.KEY_LOCK || lowBatPopup) && gCurrentFunction != FUNCTION_TRANSMIT && Key != KEY_PTT;
if (lck_condition)
#else
if ((gEeprom.KEY_LOCK || lowBatPopup) && gCurrentFunction != FUNCTION_TRANSMIT && Key != KEY_PTT)
#endif

View File

@@ -388,6 +388,10 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
*pMin = 0;
*pMax = ARRAY_SIZE(gSubMenu_OFF_ON) - 1;
break;
case MENU_SET_LCK:
*pMin = 0;
*pMax = ARRAY_SIZE(gSubMenu_SET_LCK) - 1;
break;
#endif
default:
@@ -852,6 +856,9 @@ void MENU_AcceptSetting(void)
case MENU_SET_INV:
gSetting_set_inv = gSubMenuSelection;
break;
case MENU_SET_LCK:
gSetting_set_lck = gSubMenuSelection;
break;
#endif
}
@@ -1238,6 +1245,9 @@ void MENU_ShowCurrentSetting(void)
case MENU_SET_INV:
gSubMenuSelection = gSetting_set_inv;
break;
case MENU_SET_LCK:
gSubMenuSelection = gSetting_set_lck;
break;
#endif
default: