mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-12 19:10:32 +03:00
parent
fd2d1185c0
commit
2a64051a22
1 changed files with 3 additions and 1 deletions
|
@ -344,6 +344,9 @@ FAST_CODE void scheduler(void)
|
|||
if (selectedTask) {
|
||||
// Found a task that should be run
|
||||
selectedTask->taskLatestDeltaTime = currentTimeUs - selectedTask->lastExecutedAt;
|
||||
#if defined(USE_TASK_STATISTICS)
|
||||
float period = currentTimeUs - selectedTask->lastExecutedAt;
|
||||
#endif
|
||||
selectedTask->lastExecutedAt = currentTimeUs;
|
||||
selectedTask->lastDesiredAt += (cmpTimeUs(currentTimeUs, selectedTask->lastDesiredAt) / selectedTask->desiredPeriod) * selectedTask->desiredPeriod;
|
||||
selectedTask->dynamicPriority = 0;
|
||||
|
@ -351,7 +354,6 @@ FAST_CODE void scheduler(void)
|
|||
// Execute task
|
||||
#if defined(USE_TASK_STATISTICS)
|
||||
if (calculateTaskStatistics) {
|
||||
float period = currentTimeUs - selectedTask->lastExecutedAt;
|
||||
const timeUs_t currentTimeBeforeTaskCall = micros();
|
||||
selectedTask->taskFunc(currentTimeBeforeTaskCall);
|
||||
const timeUs_t taskExecutionTime = micros() - currentTimeBeforeTaskCall;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue