From 93e02388c86e66b70a781e109068e721e903b861 Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Tue, 5 Jun 2018 16:32:59 +1200 Subject: [PATCH] More fixes. --- src/main/fc/fc_rc.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main/fc/fc_rc.c b/src/main/fc/fc_rc.c index 59dec91a2..a9685ed1d 100644 --- a/src/main/fc/fc_rc.c +++ b/src/main/fc/fc_rc.c @@ -333,19 +333,21 @@ FAST_CODE uint8_t processRcSmoothingFilter(void) DEBUG_SET(DEBUG_RC_SMOOTHING, 3, defaultInputCutoffFrequency); for (updatedChannel = 0; updatedChannel < PRIMARY_CHANNEL_COUNT; updatedChannel++) { - if (filterInitialized && (1 << updatedChannel) & interpolationChannels) { - switch (rxConfig()->rc_smoothing_input_type) { - case RC_SMOOTHING_INPUT_BIQUAD: - rcCommand[updatedChannel] = biquadFilterApply(&rcCommandFilterBiquad[updatedChannel], lastRxData[updatedChannel]); - break; - case RC_SMOOTHING_INPUT_PT1: - default: - rcCommand[updatedChannel] = pt1FilterApply(&rcCommandFilterPt1[updatedChannel], lastRxData[updatedChannel]); - break; + if ((1 << updatedChannel) & interpolationChannels) { + if (filterInitialized) { + switch (rxConfig()->rc_smoothing_input_type) { + case RC_SMOOTHING_INPUT_BIQUAD: + rcCommand[updatedChannel] = biquadFilterApply(&rcCommandFilterBiquad[updatedChannel], lastRxData[updatedChannel]); + break; + case RC_SMOOTHING_INPUT_PT1: + default: + rcCommand[updatedChannel] = pt1FilterApply(&rcCommandFilterPt1[updatedChannel], lastRxData[updatedChannel]); + break; + } + } else { + // If filter isn't initialized yet then use the actual unsmoothed rx channel data + rcCommand[updatedChannel] = lastRxData[updatedChannel]; } - } else { - // If filter isn't initialized yet then use the actual unsmoothed rx channel data - rcCommand[updatedChannel] = lastRxData[updatedChannel]; } }