Use ETX instead of OTX (also as a file extension).
This commit is contained in:
committed by
Raphael Coeffic
parent
20961e460b
commit
89517d8bd8
@@ -1132,7 +1132,7 @@ bool w_modSubtype(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
// data as-is (no FrSky special casing)
|
||||
int type = md->getMultiProtocol() + 1;
|
||||
int subtype = val;
|
||||
convertOtxProtocolToMulti(&type, &subtype);
|
||||
convertEtxProtocolToMulti(&type, &subtype);
|
||||
|
||||
// output "[type],[subtype]"
|
||||
str = yaml_unsigned2str(type);
|
||||
|
||||
@@ -473,7 +473,7 @@ const char * eeBackupModel(uint8_t i_fileSrc)
|
||||
|
||||
uint16_t size = eeModelSize(i_fileSrc);
|
||||
|
||||
*(uint32_t*)&buf[0] = OTX_FOURCC;
|
||||
*(uint32_t*)&buf[0] = ETX_FOURCC;
|
||||
buf[4] = g_eeGeneral.version;
|
||||
buf[5] = 'M';
|
||||
*(uint16_t*)&buf[6] = size;
|
||||
@@ -540,7 +540,7 @@ const char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
|
||||
}
|
||||
|
||||
uint8_t version = (uint8_t)buf[4];
|
||||
if (*(uint32_t*)&buf[0] != OTX_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
|
||||
if (*(uint32_t*)&buf[0] != ETX_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
|
||||
f_close(&restoreFile);
|
||||
return STR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ const char * eeBackupModel(uint8_t i_fileSrc)
|
||||
EFile theFile2;
|
||||
theFile2.openRd(FILE_MODEL(i_fileSrc));
|
||||
|
||||
*(uint32_t*)&buf[0] = OTX_FOURCC;
|
||||
*(uint32_t*)&buf[0] = ETX_FOURCC;
|
||||
buf[4] = g_eeGeneral.version;
|
||||
buf[5] = 'M';
|
||||
*(uint16_t*)&buf[6] = eeModelSize(i_fileSrc);
|
||||
@@ -561,7 +561,7 @@ const char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
|
||||
}
|
||||
|
||||
uint8_t version = (uint8_t)buf[4];
|
||||
if (*(uint32_t*)&buf[0] != OTX_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
|
||||
if (*(uint32_t*)&buf[0] != ETX_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
|
||||
f_close(&g_oLogFile);
|
||||
return STR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ const char *writeFileBin(const char *filename, const uint8_t *data,
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
*(uint32_t*)&buf[0] = OTX_FOURCC;
|
||||
*(uint32_t*)&buf[0] = ETX_FOURCC;
|
||||
buf[4] = version;
|
||||
buf[5] = 'M';
|
||||
*(uint16_t*)&buf[6] = size;
|
||||
@@ -99,7 +99,7 @@ const char* openFileBin(const char * fullpath, FIL * file, uint16_t * size, uint
|
||||
}
|
||||
|
||||
*version = (uint8_t)buf[4];
|
||||
if (*(uint32_t *)&buf[0] != OTX_FOURCC || *version < FIRST_CONV_EEPROM_VER ||
|
||||
if (*(uint32_t *)&buf[0] != ETX_FOURCC || *version < FIRST_CONV_EEPROM_VER ||
|
||||
*version > EEPROM_VER || buf[5] != 'M') {
|
||||
f_close(file);
|
||||
return STR_INCOMPATIBLE;
|
||||
|
||||
@@ -1646,8 +1646,8 @@ static void r_modSubtype(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
val++; val_len--;
|
||||
int subtype = yaml_str2uint(val, val_len);
|
||||
|
||||
// convert to OTX format and write to vars
|
||||
convertMultiProtocolToOtx(&type, &subtype);
|
||||
// convert to ETX format and write to vars
|
||||
convertMultiProtocolToEtx(&type, &subtype);
|
||||
if (type > 0) {
|
||||
md->setMultiProtocol(type - 1);
|
||||
md->subType = subtype;
|
||||
|
||||
Reference in New Issue
Block a user