Merge pull request #989 from aaronchch/aaronchch/heli_issue_934

Aaronchch/heli issue 934
This commit is contained in:
Bertrand Songis
2014-04-19 08:06:28 +02:00
2 changed files with 13 additions and 5 deletions
+1
View File
@@ -1188,6 +1188,7 @@ PACK(typedef struct t_MavlinkData {
#endif
enum SwashType {
SWASH_TYPE_NONE,
SWASH_TYPE_120,
SWASH_TYPE_120X,
SWASH_TYPE_140,
+12 -5
View File
@@ -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)