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
+5 -1
View File
@@ -757,7 +757,7 @@ uint16_t eeLoadModelData(uint8_t index)
return theFile.readRlc((uint8_t*)&g_model, sizeof(g_model));
}
bool eeLoadGeneral()
bool eeLoadGeneral(bool allowConversion)
{
theFile.openRlc(FILE_GENERAL);
if (theFile.readRlc((uint8_t*)&g_eeGeneral, 3) == 3 && g_eeGeneral.version == EEPROM_VER) {
@@ -796,6 +796,10 @@ bool eeLoadGeneral()
#endif
#if defined(EEPROM_CONVERSIONS)
if (g_eeGeneral.version != EEPROM_VER) {
if (!allowConversion) {
storageClearRadioSetting();
return true; // prevent eeprom from being wiped
}
TRACE("EEPROM version %d instead of %d", g_eeGeneral.version, EEPROM_VER);
if (!eeConvert()) {
return false;