1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-19 14:25:11 +03:00
This commit is contained in:
bsongis 2014-04-14 16:19:19 +02:00
parent f2dba0a9ba
commit 01ee8c31fc

View file

@ -946,6 +946,13 @@ int expo(int x, int k)
return neg? -y : y;
}
#if defined(HELI)
int16_t cyc_anas[3] = {0};
#if defined(PCBTARANIS)
int16_t heliAnas[4] = {0};
#endif
#endif
void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS)
{
#if !defined(PCBTARANIS)
@ -967,10 +974,21 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS)
continue;
if (getSwitch(ed->swtch)) {
#if defined(PCBTARANIS)
int v = (ed->srcRaw == ovwrIdx ? ovwrValue : getValue(ed->srcRaw));
if (ed->srcRaw != ovwrIdx && ed->srcRaw >= MIXSRC_FIRST_TELEM && ed->scale > 0) {
int v;
if (ed->srcRaw == ovwrIdx)
v = ovwrValue;
#if defined(HELI)
else if (ed->srcRaw == MIXSRC_Ele)
v = heliAnas[ELE_STICK];
else if (ed->srcRaw == MIXSRC_Ail)
v = heliAnas[AIL_STICK];
#endif
else {
v = getValue(ed->srcRaw);
if (ed->srcRaw >= MIXSRC_FIRST_TELEM && ed->scale > 0) {
v = limit(-1024, int((v * 1024) / convertTelemValue(ed->srcRaw-MIXSRC_FIRST_TELEM+1, ed->scale)), 1024);
}
}
#else
int16_t v = anas2[ed->chn];
#endif
@ -1193,9 +1211,6 @@ int16_t applyLimits(uint8_t channel, int32_t value)
int16_t calibratedStick[NUM_STICKS+NUM_POTS];
int16_t channelOutputs[NUM_CHNOUT] = {0};
int16_t ex_chans[NUM_CHNOUT] = {0}; // Outputs (before LIMITS) of the last perMain;
#ifdef HELI
int16_t cyc_anas[3] = {0};
#endif
// TODO same naming convention than the putsMixerSource
@ -3179,9 +3194,9 @@ 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);
v = (int32_t(v) * calc100toRESX(g_model.swashR.value)) / int32_t(d);
#if defined(PCBTARANIS)
calibratedStick[ch] = v;
heliAnas[ch] = v;
#endif
}
#endif
@ -3662,7 +3677,7 @@ void evalFunctions()
}
#if defined(PCBTARANIS)
#define HELI_ANAS_ARRAY calibratedStick
#define HELI_ANAS_ARRAY heliAnas
#else
#define HELI_ANAS_ARRAY anas
#endif