mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Change scheduler_optimze_rate to only affect realtime tasks
Reduces CPU load by not rate optimizing non timing-critical tasks.
This commit is contained in:
parent
de1c1d5377
commit
74d71fc3eb
1 changed files with 5 additions and 1 deletions
|
@ -257,7 +257,11 @@ void schedulerOptimizeRate(bool optimizeRate)
|
|||
|
||||
inline static timeUs_t getPeriodCalculationBasis(const cfTask_t* task)
|
||||
{
|
||||
return *(timeUs_t*)((uint8_t*)task + periodCalculationBasisOffset);
|
||||
if (task->staticPriority == TASK_PRIORITY_REALTIME) {
|
||||
return *(timeUs_t*)((uint8_t*)task + periodCalculationBasisOffset);
|
||||
} else {
|
||||
return task->lastExecutedAt;
|
||||
}
|
||||
}
|
||||
|
||||
FAST_CODE void scheduler(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue