mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Switched FPort to use RX frame deltas for refresh rate calculate.
This commit is contained in:
parent
dc5671f34c
commit
ec5816eae0
2 changed files with 6 additions and 19 deletions
|
@ -166,9 +166,12 @@ static void taskUpdateRxMain(timeUs_t currentTimeUs)
|
|||
return;
|
||||
}
|
||||
|
||||
timeDelta_t refreshRateUs;
|
||||
if (!rxTryGetFrameDeltaOrZero(&refreshRateUs)) {
|
||||
refreshRateUs = cmpTimeUs(currentTimeUs, lastRxTimeUs); // calculate a delta here if not supplied by the protocol
|
||||
timeDelta_t frameAgeUs;
|
||||
timeDelta_t refreshRateUs = rxGetFrameDelta(&frameAgeUs);
|
||||
if (!refreshRateUs || cmpTimeUs(currentTimeUs, lastRxTimeUs) <= frameAgeUs) {
|
||||
if (!rxTryGetFrameDeltaOrZero(&refreshRateUs)) {
|
||||
refreshRateUs = cmpTimeUs(currentTimeUs, lastRxTimeUs); // calculate a delta here if not supplied by the protocol
|
||||
}
|
||||
}
|
||||
lastRxTimeUs = currentTimeUs;
|
||||
currentRxRefreshRate = constrain(refreshRateUs, 1000, 30000);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue