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
+10 -7
View File
@@ -86,17 +86,18 @@ void eeLoadModelHeaders()
}
}
void storageClearRadioSetting()
void storageClearRadioSettings()
{
memclear(&g_eeGeneral, sizeof(RadioData));
}
void storageReadRadioSettings(bool allowConversion)
bool storageReadRadioSettings(bool allowFixes)
{
if (g_eeGeneral.version != 0)
return;
if (!eepromOpen() || !eeLoadGeneral(allowConversion)) {
if (!eepromOpen() || !eeLoadGeneral(allowFixes)) {
if (!allowFixes) {
storageClearRadioSettings();
return false;
}
storageEraseAll(true);
}
else {
@@ -109,6 +110,8 @@ void storageReadRadioSettings(bool allowConversion)
currentLanguagePack = languagePacks[i];
}
}
return true;
}
void storageReadCurrentModel()
@@ -118,7 +121,7 @@ void storageReadCurrentModel()
void storageReadAll()
{
storageReadRadioSettings(true);
storageReadRadioSettings();
storageReadCurrentModel();
}