1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 00:05:28 +03:00

Improved formatting of tasks statistics in CLI.

This commit is contained in:
Martin Budden 2016-03-15 22:39:52 +00:00 committed by Konstantin Sharlaimov (DigitalEntity)
parent 324711ddda
commit 3a6a27e4bd
3 changed files with 6 additions and 2 deletions

View file

@ -2420,11 +2420,13 @@ static void cliTasks(char *cmdline)
cfTaskId_e taskId;
cfTaskInfo_t taskInfo;
printf("Task list:\r\n");
printf("Task list max/us avg/us rate/hz total/ms\r\n");
for (taskId = 0; taskId < TASK_COUNT; taskId++) {
getTaskInfo(taskId, &taskInfo);
if (taskInfo.isEnabled) {
printf("%d - %s, max = %d us, avg = %d us, total = %d ms\r\n", taskId, taskInfo.taskName, taskInfo.maxExecutionTime, taskInfo.averageExecutionTime, taskInfo.totalExecutionTime / 1000);
const uint16_t taskFrequency = (uint16_t)(1.0f / ((float)taskInfo.latestDeltaTime * 0.000001f));
printf("%2d - %12s, %6d, %5d, %5d, %8d\r\n",
taskId, taskInfo.taskName, taskInfo.maxExecutionTime, taskInfo.averageExecutionTime, taskFrequency, taskInfo.totalExecutionTime / 1000);
}
}
}