Fixes #1872
This commit is contained in:
@@ -834,8 +834,13 @@ int ConvertSwitch_216_to_217(int swtch)
|
|||||||
if (swtch < 0)
|
if (swtch < 0)
|
||||||
return -ConvertSwitch_216_to_217(-swtch);
|
return -ConvertSwitch_216_to_217(-swtch);
|
||||||
|
|
||||||
|
#if defined(REV9E)
|
||||||
if (swtch >= SWSRC_SI0)
|
if (swtch >= SWSRC_SI0)
|
||||||
swtch += 12;
|
swtch += 10*2;
|
||||||
|
#else
|
||||||
|
if (swtch >= SWSRC_SI0)
|
||||||
|
swtch += 6*2;
|
||||||
|
#endif
|
||||||
|
|
||||||
return swtch;
|
return swtch;
|
||||||
}
|
}
|
||||||
@@ -848,7 +853,11 @@ int ConvertSwitch_216_to_217(int swtch)
|
|||||||
|
|
||||||
int ConvertSource_216_to_217(int source)
|
int ConvertSource_216_to_217(int source)
|
||||||
{
|
{
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS) && defined(REV9E)
|
||||||
|
// SI to SR switches added
|
||||||
|
if (source >= MIXSRC_SI)
|
||||||
|
source += 10;
|
||||||
|
#elif defined(PCBTARANIS)
|
||||||
// SI to SN switches added
|
// SI to SN switches added
|
||||||
if (source >= MIXSRC_SI)
|
if (source >= MIXSRC_SI)
|
||||||
source += 6;
|
source += 6;
|
||||||
@@ -1327,12 +1336,16 @@ void ConvertModel_216_to_217(ModelData &model)
|
|||||||
|
|
||||||
memcpy(&newModel.header, &oldModel.header, sizeof(newModel.header));
|
memcpy(&newModel.header, &oldModel.header, sizeof(newModel.header));
|
||||||
for (uint8_t i=0; i<2; i++) {
|
for (uint8_t i=0; i<2; i++) {
|
||||||
newModel.timers[i].mode = oldModel.timers[i].mode;
|
TimerData & timer = newModel.timers[i];
|
||||||
newModel.timers[i].start = oldModel.timers[i].start;
|
if (oldModel.timers[i].mode >= TMRMODE_COUNT)
|
||||||
newModel.timers[i].countdownBeep = oldModel.timers[i].countdownBeep;
|
timer.mode = TMRMODE_COUNT + ConvertSwitch_216_to_217(oldModel.timers[i].mode - TMRMODE_COUNT + 1) - 1;
|
||||||
newModel.timers[i].minuteBeep = oldModel.timers[i].minuteBeep;
|
else
|
||||||
newModel.timers[i].persistent = oldModel.timers[i].persistent;
|
timer.mode = oldModel.timers[i].mode;
|
||||||
newModel.timers[i].value = oldModel.timers[i].value;
|
timer.start = oldModel.timers[i].start;
|
||||||
|
timer.countdownBeep = oldModel.timers[i].countdownBeep;
|
||||||
|
timer.minuteBeep = oldModel.timers[i].minuteBeep;
|
||||||
|
timer.persistent = oldModel.timers[i].persistent;
|
||||||
|
timer.value = oldModel.timers[i].value;
|
||||||
}
|
}
|
||||||
newModel.telemetryProtocol = oldModel.telemetryProtocol;
|
newModel.telemetryProtocol = oldModel.telemetryProtocol;
|
||||||
newModel.thrTrim = oldModel.thrTrim;
|
newModel.thrTrim = oldModel.thrTrim;
|
||||||
|
|||||||
Reference in New Issue
Block a user