From 6d49f9158d516f8421b67aaa9033ab7654b92a15 Mon Sep 17 00:00:00 2001 From: 3djc Date: Fri, 4 Dec 2020 16:03:41 +0100 Subject: [PATCH] Fix --- radio/src/opentx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index e34b011d6..e29df77cc 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1831,14 +1831,14 @@ void moveTrimsToOffsets() // copy state of 3 primary to subtrim evalFlightModeMixes(e_perout_mode_noinput-e_perout_mode_notrims, 0); // do output loop - only trims - for (uint8_t i=0; i<4; i++) { + for (uint8_t i = 0; i < MAX_OUTPUT_CHANNELS; i++) { int16_t diff = applyLimits(i, chans[i]) - zeros[i]; int16_t v = g_model.limitData[i].offset; if (g_model.limitData[i].revert) diff = -diff; v += (diff * 125) / 128; - g_model.limitData[i].offset = limit((int16_t)-1000, (int16_t)v, (int16_t)1000); // make sure the offset doesn't go haywire + g_model.limitData[i].offset = limit((int16_t) -1000, (int16_t) v, (int16_t) 1000); // make sure the offset doesn't go haywire } // reset all trims, except throttle (if throttle trim)