1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 09:45:21 +03:00

Conversions now run when restoring old Model backups

This commit is contained in:
bsongis 2014-04-07 11:54:31 +02:00
parent 451463505d
commit d1d499a299
6 changed files with 48 additions and 19 deletions

View file

@ -753,7 +753,8 @@ const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
return SDCARD_ERROR(result);
}
if (*(uint32_t*)&buf[0] != O9X_FOURCC || (uint8_t)buf[4] != EEPROM_VER || buf[5] != 'M') {
uint8_t version = (uint8_t)buf[4];
if (*(uint32_t*)&buf[0] != O9X_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
f_close(&restoreFile);
return STR_INCOMPATIBLE;
}
@ -784,6 +785,14 @@ const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
Eeprom32_process_state = E32_BLANKCHECK;
eeWaitFinished();
#if defined(CPUARM)
if (version < EEPROM_VER) {
eeCheck(true);
ConvertModel(i_fileDst, version);
loadModel(g_eeGeneral.currModel);
}
#endif
return NULL;
}
#endif