1
0
Fork 0
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 (#8169)

Change scheduler_optimze_rate to only affect realtime tasks
This commit is contained in:
Michael Keller 2019-05-06 18:57:27 +12:00 committed by GitHub
commit 441d8e3336
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)