Do not try to convert the eeprom until radio is fully ON. (#6668)

This commit is contained in:
Raphael Coeffic
2019-08-27 10:20:03 +02:00
committed by Bertrand Songis
parent 3531e29cad
commit f9903dca66
7 changed files with 30 additions and 10 deletions
+11 -3
View File
@@ -86,9 +86,17 @@ void eeLoadModelHeaders()
}
}
void storageReadRadioSettings()
void storageClearRadioSetting()
{
if (!eepromOpen() || !eeLoadGeneral()) {
memclear(&g_eeGeneral, sizeof(RadioData));
}
void storageReadRadioSettings(bool allowConversion)
{
if (g_eeGeneral.version != 0)
return;
if (!eepromOpen() || !eeLoadGeneral(allowConversion)) {
storageEraseAll(true);
}
else {
@@ -110,7 +118,7 @@ void storageReadCurrentModel()
void storageReadAll()
{
storageReadRadioSettings();
storageReadRadioSettings(true);
storageReadCurrentModel();
}