Conversions now run when restoring old Model backups

This commit is contained in:
bsongis
2014-04-07 12:00:02 +02:00
parent 451463505d
commit d1d499a299
6 changed files with 48 additions and 19 deletions
+11 -2
View File
@@ -663,7 +663,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(&g_oLogFile);
return STR_INCOMPATIBLE;
}
@@ -702,6 +703,14 @@ const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
f_close(&g_oLogFile);
#if defined(CPUARM)
if (version < EEPROM_VER) {
eeCheck(true);
ConvertModel(i_fileDst, version);
loadModel(g_eeGeneral.currModel);
}
#endif
#if defined(CPUARM)
eeLoadModelHeader(i_fileDst, &modelHeaders[i_fileDst]);
#endif
@@ -760,7 +769,7 @@ void RlcFile::nextRlcWriteStep()
return;
}
}
else{
else {
m_rlc_buf+=cnt0;
m_rlc_len-=cnt0+cnt;
m_cur_rlc_len=cnt;