From 1dd761b3909051629c6991f6038953ecf926ec12 Mon Sep 17 00:00:00 2001 From: aaronchch Date: Fri, 18 Apr 2014 22:09:43 +1200 Subject: [PATCH 1/2] Fixes 934 --- radio/src/myeeprom.h | 1 + radio/src/opentx.cpp | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 38b61eea1..e95da27d9 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -1188,6 +1188,7 @@ PACK(typedef struct t_MavlinkData { #endif enum SwashType { + SWASH_TYPE_NONE, SWASH_TYPE_120, SWASH_TYPE_120X, SWASH_TYPE_140, diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 771064b51..ee8e02113 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -983,9 +983,9 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) if (ed->srcRaw == ovwrIdx) v = ovwrValue; #if defined(HELI) - else if (ed->srcRaw == MIXSRC_Ele && g_model.swashR.value) + else if (ed->srcRaw == MIXSRC_Ele) v = heliAnas[ELE_STICK]; - else if (ed->srcRaw == MIXSRC_Ail && g_model.swashR.value) + else if (ed->srcRaw == MIXSRC_Ail) v = heliAnas[AIL_STICK]; #endif else { @@ -1035,6 +1035,13 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) virtualInputsTrims[cur_chn] = ed->srcRaw - MIXSRC_Rud; else virtualInputsTrims[cur_chn] = -1; + +#if defined(HELI) + if (ed->srcRaw == MIXSRC_Ele) + heliAnas[ELE_STICK] = v; + else if (ed->srcRaw == MIXSRC_Ail) + heliAnas[AIL_STICK] = v; +#endif #endif anas[cur_chn] = v; @@ -3200,10 +3207,10 @@ void evalInputs(uint8_t mode) #if defined(HELI) if (d && (ch==ELE_STICK || ch==AIL_STICK)) { v = (int32_t(v) * calc100toRESX(g_model.swashR.value)) / int32_t(d); -#if defined(PCBTARANIS) - heliAnas[ch] = v; -#endif } +#if defined(PCBTARANIS) + heliAnas[ch] = v; +#endif #endif #if !defined(PCBTARANIS) From 9ae7cb771c50150221a6b2ee913d5033c270fe9d Mon Sep 17 00:00:00 2001 From: aaronchch Date: Fri, 18 Apr 2014 22:28:25 +1200 Subject: [PATCH 2/2] Fixed tabs --- 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 ee8e02113..685c74ceb 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1037,8 +1037,8 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) virtualInputsTrims[cur_chn] = -1; #if defined(HELI) - if (ed->srcRaw == MIXSRC_Ele) - heliAnas[ELE_STICK] = v; + if (ed->srcRaw == MIXSRC_Ele) + heliAnas[ELE_STICK] = v; else if (ed->srcRaw == MIXSRC_Ail) heliAnas[AIL_STICK] = v; #endif