diff --git a/app/menu.c b/app/menu.c index fed8bf5..07b07b8 100644 --- a/app/menu.c +++ b/app/menu.c @@ -840,6 +840,12 @@ void MENU_AcceptSetting(void) gUnlockAllTxConfCnt = 0; gSetting_F_LOCK = gSubMenuSelection; + + #ifdef ENABLE_FEAT_F4HWN + if(gSetting_F_LOCK == F_LOCK_ALL) { + SETTINGS_ResetTxLock(); + } + #endif break; } #ifndef ENABLE_FEAT_F4HWN diff --git a/settings.c b/settings.c index d140979..efd78af 100644 --- a/settings.c +++ b/settings.c @@ -1026,3 +1026,17 @@ State[1] = 0 EEPROM_WriteBuffer(0x1F88, State); } #endif + +#ifdef ENABLE_FEAT_F4HWN +void SETTINGS_ResetTxLock(void) +{ + uint8_t State[8]; + for(uint8_t channel = 0; channel < 200; channel++) + { + uint16_t OffsetVFO = channel * 16; + EEPROM_ReadBuffer(OffsetVFO + 8, State, sizeof(State)); + State[4] |= (1 << 6); + EEPROM_WriteBuffer(OffsetVFO + 8, State); + } +} +#endif diff --git a/settings.h b/settings.h index 0a0ac01..8947379 100644 --- a/settings.h +++ b/settings.h @@ -319,4 +319,7 @@ void SETTINGS_WriteBuildOptions(void); #ifdef ENABLE_FEAT_F4HWN_VOL void SETTINGS_WriteCurrentVol(void); #endif +#ifdef ENABLE_FEAT_F4HWN + void SETTINGS_ResetTxLock(void); +#endif #endif