mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +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)
|
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)
|
FAST_CODE void scheduler(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue