mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-20 01:58:32 -04:00
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:
parent
817783d75c
commit
df5952f655
11 changed files with 69 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue