diff --git a/companion/src/wizarddata.cpp b/companion/src/wizarddata.cpp index b6dccc300..70a246af6 100644 --- a/companion/src/wizarddata.cpp +++ b/companion/src/wizarddata.cpp @@ -98,7 +98,6 @@ WizMix::operator ModelData() model.setDefaultInputs(settings); int mixIndex = 0; - int switchIndex = 0; int timerIndex = 0; // Safe copy model name @@ -109,20 +108,22 @@ WizMix::operator ModelData() for (int i=0; i=0 ){ - model.customFn[switchIndex].swtch.type = SWITCH_TYPE_SWITCH; - model.customFn[switchIndex].swtch.index = IS_ARM(getCurrentBoard()) ? SWITCH_SF0 : SWITCH_THR; - model.customFn[switchIndex].enabled = 1; - model.customFn[switchIndex].func = (AssignFunc)throttleChannel; - model.customFn[switchIndex].param = -100; + if ((ch.input1 == THROTTLE_INPUT || ch.input2 == THROTTLE_INPUT) && options[THROTTLE_CUT_OPTION]) { + // Add the Throttle Cut option + MixData & mix = model.mixData[mixIndex++]; + mix.destCh = i+1; + mix.srcRaw = SOURCE_TYPE_MAX; + mix.weight = -100; + mix.swtch.type = SWITCH_TYPE_SWITCH; + mix.swtch.index = IS_ARM(getCurrentBoard()) ? SWITCH_SF0 : SWITCH_THR; + mix.mltpx = MLTPX_REP; + strncpy(mix.name, "Cut", MIXDATA_NAME_LEN); + mix.name[MIXDATA_NAME_LEN] = '\0'; + } } // Add the Flight Timer option