mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 20:10:18 +03:00
Fix tasks check function max time not being reset along with other stats
Each time the `tasks` CLI command is executed the task stats are reset to allow the max and average stats to represent the data since the last `tasks` command. However the task check function stats were not being reset so the "max" would represent the maximum value since boot.
This commit is contained in:
parent
b6a48777e4
commit
1b5f553d2e
4 changed files with 10 additions and 0 deletions
|
@ -4762,6 +4762,7 @@ static void cliTasks(char *cmdline)
|
||||||
getCheckFuncInfo(&checkFuncInfo);
|
getCheckFuncInfo(&checkFuncInfo);
|
||||||
cliPrintLinef("RX Check Function %19d %7d %25d", checkFuncInfo.maxExecutionTime, checkFuncInfo.averageExecutionTime, checkFuncInfo.totalExecutionTime / 1000);
|
cliPrintLinef("RX Check Function %19d %7d %25d", checkFuncInfo.maxExecutionTime, checkFuncInfo.averageExecutionTime, checkFuncInfo.totalExecutionTime / 1000);
|
||||||
cliPrintLinef("Total (excluding SERIAL) %25d.%1d%% %4d.%1d%%", maxLoadSum/10, maxLoadSum%10, averageLoadSum/10, averageLoadSum%10);
|
cliPrintLinef("Total (excluding SERIAL) %25d.%1d%% %4d.%1d%%", maxLoadSum/10, maxLoadSum%10, averageLoadSum/10, averageLoadSum%10);
|
||||||
|
schedulerResetCheckFunctionMaxExecutionTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -243,6 +243,13 @@ void schedulerResetTaskMaxExecutionTime(cfTaskId_e taskId)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(USE_TASK_STATISTICS)
|
||||||
|
void schedulerResetCheckFunctionMaxExecutionTime(void)
|
||||||
|
{
|
||||||
|
checkFuncMaxExecutionTime = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void schedulerInit(void)
|
void schedulerInit(void)
|
||||||
{
|
{
|
||||||
calculateTaskStatistics = true;
|
calculateTaskStatistics = true;
|
||||||
|
|
|
@ -184,6 +184,7 @@ timeDelta_t getTaskDeltaTime(cfTaskId_e taskId);
|
||||||
void schedulerSetCalulateTaskStatistics(bool calculateTaskStatistics);
|
void schedulerSetCalulateTaskStatistics(bool calculateTaskStatistics);
|
||||||
void schedulerResetTaskStatistics(cfTaskId_e taskId);
|
void schedulerResetTaskStatistics(cfTaskId_e taskId);
|
||||||
void schedulerResetTaskMaxExecutionTime(cfTaskId_e taskId);
|
void schedulerResetTaskMaxExecutionTime(cfTaskId_e taskId);
|
||||||
|
void schedulerResetCheckFunctionMaxExecutionTime(void);
|
||||||
|
|
||||||
void schedulerInit(void);
|
void schedulerInit(void);
|
||||||
void scheduler(void);
|
void scheduler(void);
|
||||||
|
|
|
@ -310,6 +310,7 @@ const char *armingDisableFlagNames[]= {
|
||||||
void getTaskInfo(cfTaskId_e, cfTaskInfo_t *) {}
|
void getTaskInfo(cfTaskId_e, cfTaskInfo_t *) {}
|
||||||
void getCheckFuncInfo(cfCheckFuncInfo_t *) {}
|
void getCheckFuncInfo(cfCheckFuncInfo_t *) {}
|
||||||
void schedulerResetTaskMaxExecutionTime(cfTaskId_e) {}
|
void schedulerResetTaskMaxExecutionTime(cfTaskId_e) {}
|
||||||
|
void schedulerResetCheckFunctionMaxExecutionTime(void) {}
|
||||||
|
|
||||||
const char * const targetName = "UNITTEST";
|
const char * const targetName = "UNITTEST";
|
||||||
const char* const buildDate = "Jan 01 2017";
|
const char* const buildDate = "Jan 01 2017";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue