From 93646983b53c3d9d1c7dcb0c8ca5edf18e8a7261 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 23 Jan 2014 10:27:00 +0100 Subject: [PATCH] [9x stock] Issue #542 - 2 bytes here --- radio/src/opentx.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index aa63566aa..b4900f8d1 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -3403,6 +3403,9 @@ void perOut(uint8_t mode, uint8_t tick10ms) if (md->srcRaw == 0) break; + uint8_t stickIndex = md->srcRaw - MIXSRC_Rud; + #define MIX_SRCRAW (stickIndex + MIXSRC_Rud) + if (!(dirtyChannels & ((bitfield_channels_t)1 << md->destCh))) continue; // if this is the first calculation for the destination channel, initialize it with 0 (otherwise would be random) @@ -3415,8 +3418,6 @@ void perOut(uint8_t mode, uint8_t tick10ms) delayval_t mixEnabled = !(md->phases & (1 << s_perout_flight_phase)) && getSwitch(md->swtch); //========== VALUE =============== - uint8_t stickIndex = md->srcRaw - MIXSRC_Rud; - #define MIX_SRCRAW (stickIndex + MIXSRC_Rud) getvalue_t v = 0; if (mode > e_perout_mode_inactive_phase) { if (!mixEnabled || stickIndex >= NUM_STICKS || (stickIndex == THR_STICK && g_model.thrTrim)) {