1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 03:50:02 +03:00

Use averageDeltaTime when calculating CPU load

This commit is contained in:
SteveCEvans 2019-01-23 19:50:33 +00:00
parent a4ce8b5600
commit faf33d1130
3 changed files with 11 additions and 1 deletions

View file

@ -3775,7 +3775,7 @@ static void cliTasks(char *cmdline)
cliPrintf("%02d - (%11s/%3s) ", taskId, taskInfo.subTaskName, taskInfo.taskName);
}
} else {
taskFrequency = taskInfo.latestDeltaTime == 0 ? 0 : (int)(1000000.0f / ((float)taskInfo.latestDeltaTime));
taskFrequency = taskInfo.averageDeltaTime == 0 ? 0 : (int)(1000000.0f / ((float)taskInfo.averageDeltaTime));
cliPrintf("%02d - (%15s) ", taskId, taskInfo.taskName);
}
const int maxLoad = taskInfo.maxExecutionTime == 0 ? 0 :(taskInfo.maxExecutionTime * taskFrequency + 5000) / 1000;