Prevent reset to restart in RO mode...

This commit is contained in:
Armel FAUVEAU committed 2025-12-01 23:31:55 +01:00
1 parent 17cef5d717
commit ad9f033bc4
1 file changed
+18
+18
View File
@@ -572,6 +572,24 @@ void SETTINGS_FactoryReset(bool bIsAll)
PY25Q16_SectorErase(0x00c000);
#endif
}
// Prevent reset to restart in RO mode...
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
{
uint8_t buf[0x10];
// Bloc 0x0E70..0x0E7F -> offset 0x004000
PY25Q16_ReadBuffer(0x004000, buf, sizeof(buf));
// bit 1 = MENU_LOCK => on le force à 0
buf[4] &= (uint8_t)~0x02;
PY25Q16_WriteBuffer(0x004000, buf, sizeof(buf), true);
// cohérence RAM
gEeprom.MENU_LOCK = 0;
}
#endif
}
#ifdef ENABLE_FMRADIO