From 6f124d080717a8de498e9a2607d8cdefd593e9c1 Mon Sep 17 00:00:00 2001 From: mikeller Date: Sun, 20 Oct 2019 23:35:57 +1300 Subject: [PATCH] Cleaned up 'taskUpdateRxMain'. --- src/main/fc/tasks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/fc/tasks.c b/src/main/fc/tasks.c index a1ed90677..3b9abb5fa 100644 --- a/src/main/fc/tasks.c +++ b/src/main/fc/tasks.c @@ -160,11 +160,12 @@ static void taskUpdateAccelerometer(timeUs_t currentTimeUs) static void taskUpdateRxMain(timeUs_t currentTimeUs) { + static timeUs_t lastRxTimeUs; + if (!processRx(currentTimeUs)) { return; } - static timeUs_t lastRxTimeUs; currentRxRefreshRate = constrain(currentTimeUs - lastRxTimeUs, 1000, 30000); lastRxTimeUs = currentTimeUs; isRXDataNew = true;