From 99e87050f362a412bf9c606d4f9a74ff5d026bb9 Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 15 Sep 2014 14:12:02 +0200 Subject: [PATCH] Overflow on OverrideCHxx functions on ARM boards (range is now -150:+150) --- radio/src/mixer.cpp | 4 +++- radio/src/opentx.cpp | 4 ++-- radio/src/opentx.h | 9 ++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/radio/src/mixer.cpp b/radio/src/mixer.cpp index 82e075aab..be37379d8 100755 --- a/radio/src/mixer.cpp +++ b/radio/src/mixer.cpp @@ -252,8 +252,10 @@ int16_t applyLimits(uint8_t channel, int32_t value) if (lim->revert) ofs = -ofs; // finally do the reverse. #if defined(OVERRIDE_CHANNEL_FUNCTION) - if (safetyCh[channel] != -128) // if safety channel available for channel check + if (safetyCh[channel] != OVERRIDE_CHANNEL_UNDEFINED) { + // safety channel available for channel check ofs = calc100toRESX(safetyCh[channel]); + } #endif return ofs; diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index e3db50581..d2d0ebdf0 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -110,7 +110,7 @@ uint8_t heartbeat; uint8_t stickMode; #if defined(OVERRIDE_CHANNEL_FUNCTION) -int8_t safetyCh[NUM_CHNOUT]; +safetych_t safetyCh[NUM_CHNOUT]; #endif union ReusableBuffer reusableBuffer; @@ -1871,7 +1871,7 @@ void evalFunctions() #if defined(OVERRIDE_CHANNEL_FUNCTION) for (uint8_t i=0; i