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

Change TASK_RX frequancy from 50hz (20ms) to 33hz (30ms)

Work around to better handle RX protocols that have frame intervals >= 20ms.  Otherwise the task would run at the end of the task interval causing slower protocols to run again after the remaining delay. This interferes with rc interpolation and also the frame rate detection in rc smoothing.
This commit is contained in:
Bruce Luckcuck 2018-07-01 18:08:46 -04:00
parent 8e9e757448
commit a754ad4f47
3 changed files with 4 additions and 4 deletions

View file

@ -177,7 +177,7 @@ static void taskUpdateRxMain(timeUs_t currentTimeUs)
}
static timeUs_t lastRxTimeUs;
currentRxRefreshRate = constrain(currentTimeUs - lastRxTimeUs, 1000, 20000);
currentRxRefreshRate = constrain(currentTimeUs - lastRxTimeUs, 1000, 30000);
lastRxTimeUs = currentTimeUs;
isRXDataNew = true;
@ -459,7 +459,7 @@ cfTask_t cfTasks[TASK_COUNT] = {
.taskName = "RX",
.checkFunc = rxUpdateCheck,
.taskFunc = taskUpdateRxMain,
.desiredPeriod = TASK_PERIOD_HZ(50), // If event-based scheduling doesn't work, fallback to periodic scheduling
.desiredPeriod = TASK_PERIOD_HZ(33), // If event-based scheduling doesn't work, fallback to periodic scheduling
.staticPriority = TASK_PRIORITY_HIGH,
},