Add xTaskGetIdleRunTimeCounter() API function to return the run time stats counter for the idle task - useful for POSIX time implementations.

This commit is contained in:
Richard Barry 2019-01-21 23:39:48 +00:00
parent 817783d75c
commit df5952f655
11 changed files with 69 additions and 12 deletions

View file

@ -617,6 +617,8 @@ static portBASE_TYPE xPerformedOneShotTests = pdFALSE;
TaskHandle_t xTestTask;
TaskStatus_t xTaskInfo;
extern StackType_t uxTimerTaskStack[];
static TickType_t xLastIdleExecutionTime = 0;
TickType_t xIdleExecutionTime;
/* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and
xTaskGetIdleTaskHandle() functions. Also try using the function that sets
@ -715,6 +717,13 @@ extern StackType_t uxTimerTaskStack[];
}
}
}
xIdleExecutionTime = xTaskGetIdleRunTimeCounter();
if( xIdleExecutionTime == xLastIdleExecutionTime )
{
pcStatusMessage = "Error: Total amount of Idle task execution time did not change";
}
xLastIdleExecutionTime = xIdleExecutionTime;
}
/*-----------------------------------------------------------*/