[color] Fixed throttle trim switch setting
This commit is contained in:
@@ -672,6 +672,22 @@ PACK(struct ModelData {
|
|||||||
return thrTrimSw + MIXSRC_FIRST_TRIM;
|
return thrTrimSw + MIXSRC_FIRST_TRIM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setThrottleStickTrimSource(int16_t src)
|
||||||
|
{
|
||||||
|
// The order here is TERA, so that 0 (default) means Throttle
|
||||||
|
switch (src) {
|
||||||
|
case MIXSRC_TrimThr:
|
||||||
|
thrTrimSw = 0;
|
||||||
|
break;
|
||||||
|
case MIXSRC_TrimRud:
|
||||||
|
thrTrimSw = 2;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
thrTrimSw = src - MIXSRC_FIRST_TRIM;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1160,7 +1160,10 @@ void ModelSetupPage::build(FormWindow * window)
|
|||||||
|
|
||||||
// Throttle trim source
|
// Throttle trim source
|
||||||
new StaticText(window, grid.getLabelSlot(true), STR_TTRIM_SW);
|
new StaticText(window, grid.getLabelSlot(true), STR_TTRIM_SW);
|
||||||
new SourceChoice(window, grid.getFieldSlot(), 0, NUM_TRIMS - 1, GET_SET_DEFAULT( g_model.thrTrimSw));
|
new SourceChoice(
|
||||||
|
window, grid.getFieldSlot(), MIXSRC_FIRST_TRIM, MIXSRC_LAST_TRIM,
|
||||||
|
[=]() { return g_model.getThrottleStickTrimSource(); },
|
||||||
|
[=](int16_t src) { g_model.setThrottleStickTrimSource(src); });
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user