Add SetKey for RescueOps

This commit is contained in:
Armel FAUVEAU
2024-11-13 06:17:32 +01:00
parent cd5caff593
commit 397561e0e1
7 changed files with 55 additions and 8 deletions

View File

@@ -54,6 +54,7 @@ void SETTINGS_InitEEPROM(void)
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
gEeprom.KEY_LOCK = (Data[4] & 0x01) != 0;
gEeprom.MENU_LOCK = (Data[4] & 0x02) != 0;
gEeprom.SET_KEY = (Data[4] >> 2) & 0x0F;
#else
gEeprom.KEY_LOCK = (Data[4] < 2) ? Data[4] : false;
#endif
@@ -597,7 +598,7 @@ void SETTINGS_SaveSettings(void)
#endif
#ifdef ENABLE_FEAT_F4HWN_MENU_LOCK
State[4] = (gEeprom.KEY_LOCK ? 0x01 : 0) | (gEeprom.MENU_LOCK ? 0x02 :0);
State[4] = (gEeprom.KEY_LOCK ? 0x01 : 0) | (gEeprom.MENU_LOCK ? 0x02 :0) | ((gEeprom.SET_KEY & 0x0F) << 2);
#else
State[4] = gEeprom.KEY_LOCK;
#endif