1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Cleaned up 'taskUpdateRxMain'.

This commit is contained in:
mikeller 2019-10-20 23:35:57 +13:00
parent 564f3031b2
commit 6f124d0807

View file

@ -160,11 +160,12 @@ static void taskUpdateAccelerometer(timeUs_t currentTimeUs)
static void taskUpdateRxMain(timeUs_t currentTimeUs) static void taskUpdateRxMain(timeUs_t currentTimeUs)
{ {
static timeUs_t lastRxTimeUs;
if (!processRx(currentTimeUs)) { if (!processRx(currentTimeUs)) {
return; return;
} }
static timeUs_t lastRxTimeUs;
currentRxRefreshRate = constrain(currentTimeUs - lastRxTimeUs, 1000, 30000); currentRxRefreshRate = constrain(currentTimeUs - lastRxTimeUs, 1000, 30000);
lastRxTimeUs = currentTimeUs; lastRxTimeUs = currentTimeUs;
isRXDataNew = true; isRXDataNew = true;