1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 15:25:36 +03:00

Added protocol level RX frame rate measurement for FrSky FPort.

This commit is contained in:
mikeller 2020-02-23 13:10:31 +13:00
parent 53318e5e4d
commit dc5671f34c
9 changed files with 71 additions and 7 deletions

View file

@ -166,12 +166,12 @@ static void taskUpdateRxMain(timeUs_t currentTimeUs)
return;
}
timeDelta_t rxFrameDeltaUs;
if (!rxTryGetFrameDelta(&rxFrameDeltaUs)) {
rxFrameDeltaUs = cmpTimeUs(currentTimeUs, lastRxTimeUs); // calculate a delta here if not supplied by the protocol
timeDelta_t refreshRateUs;
if (!rxTryGetFrameDeltaOrZero(&refreshRateUs)) {
refreshRateUs = cmpTimeUs(currentTimeUs, lastRxTimeUs); // calculate a delta here if not supplied by the protocol
}
lastRxTimeUs = currentTimeUs;
currentRxRefreshRate = constrain(rxFrameDeltaUs, 1000, 30000);
currentRxRefreshRate = constrain(refreshRateUs, 1000, 30000);
isRXDataNew = true;
#ifdef USE_USB_CDC_HID