mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Scheduler - Fix unused period
warning when USE_TASK_STATISTICS
is
not defined.
This commit is contained in:
parent
4f923e4827
commit
5dd4038e1c
1 changed files with 1 additions and 1 deletions
|
@ -348,7 +348,6 @@ FAST_CODE void scheduler(void)
|
|||
if (selectedTask) {
|
||||
// Found a task that should be run
|
||||
selectedTask->taskLatestDeltaTime = currentTimeUs - selectedTask->lastExecutedAt;
|
||||
float period = currentTimeUs - selectedTask->lastExecutedAt;
|
||||
selectedTask->lastExecutedAt = currentTimeUs;
|
||||
selectedTask->lastDesiredAt += (cmpTimeUs(currentTimeUs, selectedTask->lastDesiredAt) / selectedTask->desiredPeriod) * selectedTask->desiredPeriod;
|
||||
selectedTask->dynamicPriority = 0;
|
||||
|
@ -356,6 +355,7 @@ 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