1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 17:25:13 +03:00

Fixes #1630 - Thanks to projectkk2glider for his pull request #1738 - I

only added a google test
This commit is contained in:
bsongis 2014-09-24 10:04:18 +02:00
parent f39650bf16
commit b26187f759
6 changed files with 283 additions and 206 deletions

View file

@ -645,10 +645,22 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms)
bool mixCondition = (md->flightModes != 0 || md->swtch);
delayval_t mixEnabled = (!(md->flightModes & (1 << mixerCurrentFlightMode)) && getSwitch(md->swtch)) ? DELAY_POS_MARGIN+1 : 0;
#define MIXER_LINE_DISABLE() (mixCondition = true, mixEnabled = 0)
if (mixEnabled && md->srcRaw >= MIXSRC_FIRST_TRAINER && md->srcRaw <= MIXSRC_LAST_TRAINER && !ppmInValid) {
mixEnabled = 0;
MIXER_LINE_DISABLE();
}
#if defined(PCBTARANIS) && defined(LUA_MODEL_SCRIPTS)
// disable mixer if Lua script is used as source and script was killed
if (mixEnabled && md->srcRaw >= MIXSRC_FIRST_LUA && md->srcRaw <= MIXSRC_LAST_LUA) {
div_t qr = div(md->srcRaw-MIXSRC_FIRST_LUA, MAX_SCRIPT_OUTPUTS);
if (scriptInternalData[qr.quot].state != SCRIPT_OK) {
MIXER_LINE_DISABLE();
}
}
#endif
//========== VALUE ===============
getvalue_t v = 0;
if (mode > e_perout_mode_inactive_flight_mode) {