Bsongis/boot issue invalid eeprom (#6684)

Boot issue on invalid eeprom
This commit is contained in:
Bertrand Songis
2019-08-30 13:23:49 +02:00
committed by GitHub
parent ae4a80f4be
commit ff2cde85be
7 changed files with 29 additions and 32 deletions
+4 -8
View File
@@ -256,21 +256,17 @@ void writeModel(int index)
writeFile(index+1, (uint8_t *)&g_model, sizeof(g_model));
}
bool eeLoadGeneral(bool allowConversion)
bool eeLoadGeneral(bool allowFixes)
{
eeLoadGeneralSettingsData();
if (g_eeGeneral.version != EEPROM_VER) {
TRACE("EEPROM version %d instead of %d", g_eeGeneral.version, EEPROM_VER);
#if defined(PCBSKY9X)
if (!allowConversion) {
storageClearRadioSetting();
return true; // prevent eeprom from being wiped
}
if (!eeConvert()) {
if (!allowFixes)
return false; // prevent eeprom from being wiped
if (!eeConvert())
return false;
}
#else
return false;
#endif