From f86cf7f48abdedabdd07921d9d6a1b7dabbfb738 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 3 Apr 2014 12:10:56 +0200 Subject: [PATCH] My last commit that fixed bad rounding did increase flash usage on 4.7 compiler (which is the official one) --- radio/src/opentx.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 1d9edbb40..0876aa6d8 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -4148,7 +4148,12 @@ void doMixerCalculations() // interpolate value with min/max so we get smooth motion from center to stop // this limits based on v original values and min=-1024, max=1024 RESX=1024 int32_t q = (s_fade_flight_phases ? (sum_chans512[i] / weight) << 4 : chans[i]); + +#if defined(PCBSTD) + ex_chans[i] = q >> 8; +#else ex_chans[i] = q / 256; +#endif int16_t value = applyLimits(i, q); // applyLimits will remove the 256 100% basis