From 42e8f63e2a1ce27bfa0d20ff3daef3a1c4bd05b3 Mon Sep 17 00:00:00 2001 From: Bruce Luckcuck Date: Mon, 26 Feb 2018 17:03:57 -0500 Subject: [PATCH] Change rx data processing to ensure updateArmingStatus() is called periodically There was an issue in that if no data from PPM or PWM rx inputs would result in processRx() exiting prematurely and updateArmingStatus() not being called. This affected processing of boot grace timeouts, cpu load arming disabled checking, etc. This change forces updates to occur no less frequently than 50Hz even if no data is available. --- src/main/rx/rx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/rx/rx.c b/src/main/rx/rx.c index 37a084f5ae..40f3617dd4 100644 --- a/src/main/rx/rx.c +++ b/src/main/rx/rx.c @@ -421,14 +421,17 @@ bool rxUpdateCheck(timeUs_t currentTimeUs, timeDelta_t currentDeltaTime) rxIsInFailsafeMode = (frameStatus & RX_FRAME_FAILSAFE) != 0; rxSignalReceived = !rxIsInFailsafeMode; needRxSignalBefore = currentTimeUs + needRxSignalMaxDelayUs; - } else if (cmpTimeUs(currentTimeUs, rxNextUpdateAtUs) > 0) { - rxDataProcessingRequired = true; } if (frameStatus & RX_FRAME_PROCESSING_REQUIRED) { auxiliaryProcessingRequired = true; } } + + if (cmpTimeUs(currentTimeUs, rxNextUpdateAtUs) > 0) { + rxDataProcessingRequired = true; + } + return rxDataProcessingRequired || auxiliaryProcessingRequired; // data driven or 50Hz }