Skip to content

Commit

Permalink
Use DEBUG_TIMING_ACCURACY debug[4] to record 10ths % late tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveCEvans committed Jan 31, 2024
1 parent 3668125 commit 9085a79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/scheduler/scheduler.c
Expand Up @@ -69,6 +69,7 @@
// 1 - Tasks late in last second
// 2 - Total lateness in last second in 10ths us
// 3 - Total tasks run in last second
// 4 - 10ths % of tasks late in last second

extern task_t tasks[];

Expand Down Expand Up @@ -546,6 +547,9 @@ FAST_CODE void scheduler(void)
DEBUG_SET(DEBUG_TIMING_ACCURACY, 3, taskCount);

lateTaskPercentage = 1000 * (uint32_t)lateTaskCount / taskCount;
// 10ths % of tasks late in last second
DEBUG_SET(DEBUG_TIMING_ACCURACY, 4, lateTaskPercentage);

lateTaskCount = 0;
lateTaskTotal = 0;
taskCount = 0;
Expand Down

0 comments on commit 9085a79

Please sign in to comment.