Conversion fixes
This commit is contained in:
@@ -610,14 +610,14 @@ PACK(struct ModelData {
|
||||
NOBACKUP(FrSkyTelemetryData frsky);
|
||||
NOBACKUP(RssiAlarmData rssiAlarms);
|
||||
|
||||
NOBACKUP(uint8_t spare:6);
|
||||
NOBACKUP(uint8_t spare1:6);
|
||||
NOBACKUP(uint8_t potsWarnMode:2);
|
||||
ModuleData moduleData[NUM_MODULES];
|
||||
ReceiverData receiverData[NUM_RECEIVERS];
|
||||
int16_t failsafeChannels[MAX_OUTPUT_CHANNELS];
|
||||
TrainerModuleData trainerData;
|
||||
|
||||
#if defined(PCBHORUS) || defined(PCBTARANIS)
|
||||
#if defined(PCBHORUS) || defined(PCBTARANIS)
|
||||
NOBACKUP(ScriptData scriptsData[MAX_SCRIPTS]);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -48,7 +48,12 @@ void convertModelData_218_to_219(ModelData &model)
|
||||
TRACE("Model %s conversion from v218 to v219", name);
|
||||
|
||||
for (int i=0; i<NUM_MODULES; i++) {
|
||||
memcpy(&newModel.moduleData[i], &oldModel.moduleData[i], sizeof(ModuleData));
|
||||
memcpy(&newModel.moduleData[i], &oldModel.moduleData[i], 4);
|
||||
memcpy(&newModel.moduleData[i] + 4, &oldModel.moduleData[i] + 64 + 4, 2);
|
||||
if (newModel.moduleData[i].type >= MODULE_TYPE_XJT2)
|
||||
newModel.moduleData[i].type += 1;
|
||||
if (newModel.moduleData[i].type >= MODULE_TYPE_R9M2)
|
||||
newModel.moduleData[i].type += 4;
|
||||
}
|
||||
|
||||
for (uint8_t module=0; module<2; module++) {
|
||||
@@ -66,13 +71,19 @@ void convertModelData_218_to_219(ModelData &model)
|
||||
newModel.trainerData.delay = oldModel.moduleData[NUM_MODULES].ppm.delay;
|
||||
newModel.trainerData.pulsePol = oldModel.moduleData[NUM_MODULES].ppm.pulsePol;
|
||||
|
||||
#if !defined(PCBSKY9X)
|
||||
#if defined(PCBHORUS) || defined(PCBTARANIS)
|
||||
memcpy(newModel.scriptsData, oldModel.scriptsData,
|
||||
sizeof(newModel.scriptsData) +
|
||||
sizeof(newModel.inputNames) +
|
||||
sizeof(newModel.potsWarnEnabled) +
|
||||
sizeof(newModel.potsWarnPosition) +
|
||||
sizeof(oldModel.telemetrySensors));
|
||||
#else
|
||||
memcpy(newModel.inputNames, oldModel.inputNames,
|
||||
sizeof(newModel.inputNames) +
|
||||
sizeof(newModel.potsWarnEnabled) +
|
||||
sizeof(newModel.potsWarnPosition) +
|
||||
sizeof(oldModel.telemetrySensors));
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E)
|
||||
|
||||
Reference in New Issue
Block a user