1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Merge pull request #6297 from DieHertz/bfdev-hertz-cli-task-statistics-reset-max-time

CLI tasks command: reset max execution time
This commit is contained in:
Michael Keller 2018-07-09 23:09:33 +12:00 committed by GitHub
commit ea53a18ae0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 0 deletions

View file

@ -3634,6 +3634,8 @@ static void cliTasks(char *cmdline)
if (taskId == TASK_GYROPID && pidConfig()->pid_process_denom > 1) {
cliPrintLinef(" - (%15s) %6d", taskInfo.subTaskName, subTaskFrequency);
}
schedulerResetTaskMaxExecutionTime(taskId);
}
}
if (systemConfig()->task_statistics) {

View file

@ -221,6 +221,19 @@ void schedulerResetTaskStatistics(cfTaskId_e taskId)
#endif
}
void schedulerResetTaskMaxExecutionTime(cfTaskId_e taskId)
{
#ifdef SKIP_TASK_STATISTICS
UNUSED(taskId);
#else
if (taskId == TASK_SELF) {
currentTask->maxExecutionTime = 0;
} else if (taskId < TASK_COUNT) {
cfTasks[taskId].maxExecutionTime = 0;
}
#endif
}
void schedulerInit(void)
{
calculateTaskStatistics = true;

View file

@ -177,6 +177,7 @@ void setTaskEnabled(cfTaskId_e taskId, bool newEnabledState);
timeDelta_t getTaskDeltaTime(cfTaskId_e taskId);
void schedulerSetCalulateTaskStatistics(bool calculateTaskStatistics);
void schedulerResetTaskStatistics(cfTaskId_e taskId);
void schedulerResetTaskMaxExecutionTime(cfTaskId_e taskId);
void schedulerInit(void);
void scheduler(void);

View file

@ -240,6 +240,7 @@ const char *armingDisableFlagNames[]= {
void getTaskInfo(cfTaskId_e, cfTaskInfo_t *) {}
void getCheckFuncInfo(cfCheckFuncInfo_t *) {}
void schedulerResetTaskMaxExecutionTime(cfTaskId_e) {}
const char * const targetName = "UNITTEST";
const char* const buildDate = "Jan 01 2017";