Merge branch 'next' of https://github.com/opentx/opentx into kilrah/Switch_and_pot_warnings
Conflicts: companion/src/firmwares/opentx/opentxeeprom.cpp radio/src/gui/menu_model.cpp radio/src/opentx.cpp radio/src/telemetry/frsky.cpp radio/src/translations.cpp radio/src/translations.h radio/src/translations/cz.h.txt radio/src/translations/de.h.txt radio/src/translations/en.h radio/src/translations/es.h.txt radio/src/translations/fr.h.txt radio/src/translations/it.h.txt radio/src/translations/pl.h.txt radio/src/translations/pt.h.txt radio/src/translations/se.h.txt
This commit is contained in:
@@ -195,6 +195,21 @@ void ConvertGeneralSettings_215_to_216(EEGeneral &settings)
|
||||
settings.version = 216;
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
int ConvertSwitch_215_to_216(int swtch)
|
||||
{
|
||||
if (swtch < SWSRC_ON)
|
||||
return swtch;
|
||||
else
|
||||
return swtch + (2*6); // 2 * 6-pos pots added as switches
|
||||
}
|
||||
#else
|
||||
inline int ConvertSwitch_215_to_216(int swtch)
|
||||
{
|
||||
return swtch;
|
||||
}
|
||||
#endif
|
||||
|
||||
void ConvertModel_215_to_216(ModelData &model)
|
||||
{
|
||||
// Virtual inputs added instead of Expo/DR
|
||||
@@ -206,6 +221,7 @@ void ConvertModel_215_to_216(ModelData &model)
|
||||
// Custom Switches: better precision for x when A comes from telemetry
|
||||
// Main View: altitude in top bar
|
||||
// Mixes: GVARS in weight moved from 512 to 4096 and -512 to -4096, because GVARS may be used in limits [-1250:1250]
|
||||
// Switches: two 6-pos pots added
|
||||
|
||||
TRACE("Model conversion from v215 to v216");
|
||||
|
||||
@@ -226,7 +242,7 @@ void ConvertModel_215_to_216(ModelData &model)
|
||||
}
|
||||
g_model.protocol = oldModel.protocol;
|
||||
g_model.thrTrim = oldModel.thrTrim;
|
||||
g_model.trimInc = oldModel.trimInc;
|
||||
g_model.trimInc = oldModel.trimInc - 2;
|
||||
g_model.disableThrottleWarning = oldModel.disableThrottleWarning;
|
||||
g_model.extendedLimits = oldModel.extendedLimits;
|
||||
g_model.extendedTrims = oldModel.extendedTrims;
|
||||
@@ -239,7 +255,7 @@ void ConvertModel_215_to_216(ModelData &model)
|
||||
g_model.mixData[i].phases = oldModel.mixData[i].phases;
|
||||
g_model.mixData[i].mltpx = oldModel.mixData[i].mltpx;
|
||||
g_model.mixData[i].weight = oldModel.mixData[i].weight;
|
||||
g_model.mixData[i].swtch = oldModel.mixData[i].swtch;
|
||||
g_model.mixData[i].swtch = ConvertSwitch_215_to_216(oldModel.mixData[i].swtch);
|
||||
if (oldModel.mixData[i].curveMode==0/*differential*/) {
|
||||
g_model.mixData[i].curve.type = CURVE_REF_DIFF;
|
||||
g_model.mixData[i].curve.value = oldModel.mixData[i].curveParam;
|
||||
@@ -299,7 +315,7 @@ void ConvertModel_215_to_216(ModelData &model)
|
||||
}
|
||||
g_model.expoData[i].srcRaw = MIXSRC_Rud+chn;
|
||||
g_model.expoData[i].chn = chn;
|
||||
g_model.expoData[i].swtch = oldModel.expoData[i].swtch;
|
||||
g_model.expoData[i].swtch = ConvertSwitch_215_to_216(oldModel.expoData[i].swtch);
|
||||
g_model.expoData[i].phases = oldModel.expoData[i].phases;
|
||||
g_model.expoData[i].weight = oldModel.expoData[i].weight;
|
||||
memcpy(&g_model.expoData[i].name, &oldModel.expoData[i].name, LEN_EXPOMIX_NAME);
|
||||
|
||||
Reference in New Issue
Block a user