int ConvertSwitch_217_to_218(int swtch) { // 32 additional logical switches if (swtch < 0) return -ConvertSwitch_217_to_218(-swtch); if (swtch >= SWSRC_FIRST_LOGICAL_SWITCH+32) return swtch+32; return swtch; } int ConvertSource_217_to_218(int source) { #if defined(PCBTARANIS) if (source >= MIXSRC_FIRST_LOGICAL_SWITCH + 32) source += 32; #endif return source; } void ConvertSpecialFunctions_217_to_218(CustomFunctionData * cf218, CustomFunctionData_v216 * cf216) { for (int i=0; i= TMRMODE_COUNT) newModel.timers[i].mode = TMRMODE_COUNT + ConvertSwitch_217_to_218(oldModel.timers[i].mode - TMRMODE_COUNT + 1) - 1; else newModel.timers[i].mode = ConvertSwitch_217_to_218(oldModel.timers[i].mode); if (oldModel.timers[i].mode) TRACE("timer mode %d => %d", oldModel.timers[i].mode, newModel.timers[i].mode); newModel.timers[i].start = oldModel.timers[i].start; newModel.timers[i].value = oldModel.timers[i].value; newModel.timers[i].countdownBeep = oldModel.timers[i].countdownBeep; newModel.timers[i].minuteBeep = oldModel.timers[i].minuteBeep; newModel.timers[i].persistent = oldModel.timers[i].persistent; memcpy(newModel.timers[i].name, oldModel.timers[i].name, sizeof(newModel.timers[i].name)); } newModel.telemetryProtocol = oldModel.telemetryProtocol; newModel.thrTrim = oldModel.thrTrim; newModel.noGlobalFunctions = oldModel.noGlobalFunctions; newModel.displayTrims = oldModel.displayTrims; newModel.ignoreSensorIds = oldModel.ignoreSensorIds; newModel.trimInc = oldModel.trimInc; newModel.disableThrottleWarning = oldModel.disableThrottleWarning; newModel.displayChecklist = oldModel.displayChecklist; newModel.extendedLimits = oldModel.extendedLimits; newModel.extendedTrims = oldModel.extendedTrims; newModel.throttleReversed = oldModel.throttleReversed; newModel.beepANACenter = oldModel.beepANACenter; for (int i=0; i> (2*i)) & 0x03) == TELEMETRY_SCREEN_TYPE_VALUES) { for (int j = 0; j < 4; j++) { for (int k = 0; k < NUM_LINE_ITEMS; k++) { newModel.frsky.screens[i].lines[j].sources[k] = ConvertSource_217_to_218(oldModel.frsky.screens[i].lines[j].sources[k]); } } } else if (((oldModel.frsky.screensType >> (2*i)) & 0x03) == TELEMETRY_SCREEN_TYPE_GAUGES) { for (int j = 0; j < 4; j++) { newModel.frsky.screens[i].bars[j].source = ConvertSource_217_to_218(oldModel.frsky.screens[i].bars[j].source); } } } for (int i=0; i UNIT_WATTS) newModel.telemetrySensors[i].unit += 1; } #if defined(PCBX9E) newModel.toplcdTimer = oldModel.toplcdTimer; #endif }