From 44f73a68d498139ec0c4d1c5339e8e45c24c66dc Mon Sep 17 00:00:00 2001 From: philmoz Date: Mon, 1 Jan 2024 08:48:43 +1100 Subject: [PATCH] fix(radio): Instant trim only works correctly in mode 1 (#4491) --- radio/src/opentx.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 113d3224e..72a0ab906 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1137,8 +1137,9 @@ void instantTrim() evalInputs(e_perout_mode_notrainer); auto controls = adcGetMaxInputs(ADC_INPUT_MAIN); - for (uint8_t stick = 0; stick < controls; stick++) { - if (stick != inputMappingConvertMode(inputMappingGetThrottle())) { // don't instant trim the throttle stick + for (uint8_t st = 0; st < controls; st++) { + uint8_t stick = inputMappingConvertMode(st); + if (stick != inputMappingGetThrottle()) { // don't instant trim the throttle stick bool addTrim = false; int16_t delta = 0; uint8_t trimFlightMode = getTrimFlightMode(mixerCurrentFlightMode, stick);