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

Added reset of task max time to CLI tasks command

This commit is contained in:
Andrey Mironov 2018-07-07 14:02:47 +03:00
parent ad975d3948
commit 5a66fb510f
3 changed files with 16 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);