1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 16:55:20 +03:00

[All] All FourCC changed (o9x changed to otx) (#4214)

This commit is contained in:
Bertrand Songis 2017-01-09 22:30:01 +01:00 committed by GitHub
parent 58382d8aca
commit f2b283c585
4 changed files with 15 additions and 8 deletions

View file

@ -113,11 +113,18 @@ inline const pm_char * SDCARD_ERROR(FRESULT result)
// NOTE: 'size' must = 0 or be a valid character position within 'filename' array -- it is NOT validated
const char * getFileExtension(const char * filename, uint8_t size=0, uint8_t extMaxLen=0, uint8_t *fnlen=NULL, uint8_t *extlen=NULL);
#if defined(PCBTARANIS)
// TODO REMOVE THE O9X FOURCC in 2.3
#if defined(PCBHORUS)
#define OTX_FOURCC 0x3478746F // otx for Horus
#define O9X_FOURCC 0x3178396F // we forgot it in 2.2 RC ..
#elif defined(PCBTARANIS)
#define OTX_FOURCC 0x3378746F // otx for Taranis
#define O9X_FOURCC 0x3378396F // o9x for Taranis
#elif defined(PCBSKY9X)
#define OTX_FOURCC 0x3278746F // otx for sky9x
#define O9X_FOURCC 0x3278396F // o9x for sky9x
#else
#elif defined(PCBGRUVIN9X) || defined(PCBMEGA2560)
#define OTX_FOURCC 0x3178746F // otx for gruvin9x/MEGA2560
#define O9X_FOURCC 0x3178396F // o9x for gruvin9x/MEGA2560
#endif

View file

@ -474,7 +474,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc)
uint16_t size = eeModelSize(i_fileSrc);
*(uint32_t*)&buf[0] = O9X_FOURCC;
*(uint32_t*)&buf[0] = OTX_FOURCC;
buf[4] = g_eeGeneral.version;
buf[5] = 'M';
*(uint16_t*)&buf[6] = size;
@ -541,7 +541,7 @@ const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
}
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') {
if ((*(uint32_t*)&buf[0] != OTX_FOURCC && *(uint32_t*)&buf[0] != O9X_FOURCC) || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
f_close(&restoreFile);
return STR_INCOMPATIBLE;
}

View file

@ -538,7 +538,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc)
EFile theFile2;
theFile2.openRd(FILE_MODEL(i_fileSrc));
*(uint32_t*)&buf[0] = O9X_FOURCC;
*(uint32_t*)&buf[0] = OTX_FOURCC;
buf[4] = g_eeGeneral.version;
buf[5] = 'M';
*(uint16_t*)&buf[6] = eeModelSize(i_fileSrc);
@ -591,7 +591,7 @@ const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
}
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') {
if ((*(uint32_t*)&buf[0] != OTX_FOURCC && *(uint32_t*)&buf[0] != O9X_FOURCC) || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
f_close(&g_oLogFile);
return STR_INCOMPATIBLE;
}

View file

@ -40,7 +40,7 @@ const char * writeFile(const char * filename, const uint8_t * data, uint16_t siz
return SDCARD_ERROR(result);
}
*(uint32_t*)&buf[0] = O9X_FOURCC;
*(uint32_t*)&buf[0] = OTX_FOURCC;
buf[4] = EEPROM_VER;
buf[5] = 'M';
*(uint16_t*)&buf[6] = size;
@ -93,7 +93,7 @@ const char * loadFile(const char * filename, uint8_t * data, uint16_t maxsize)
}
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') {
if ((*(uint32_t*)&buf[0] != OTX_FOURCC && *(uint32_t*)&buf[0] != O9X_FOURCC) || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
f_close(&file);
return STR_INCOMPATIBLE;
}