+TaskHandle_t xTaskGetIdleTaskHandle( void );\r
+\r
+/**\r
+ * configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for\r
+ * uxTaskGetSystemState() to be available.\r
+ *\r
+ * uxTaskGetSystemState() populates an TaskStatus_t structure for each task in\r
+ * the system. TaskStatus_t structures contain, among other things, members\r
+ * for the task handle, task name, task priority, task state, and total amount\r
+ * of run time consumed by the task. See the TaskStatus_t structure\r
+ * definition in this file for the full member list.\r
+ *\r
+ * NOTE: This function is intended for debugging use only as its use results in\r
+ * the scheduler remaining suspended for an extended period.\r
+ *\r
+ * @param pxTaskStatusArray A pointer to an array of TaskStatus_t structures.\r
+ * The array must contain at least one TaskStatus_t structure for each task\r
+ * that is under the control of the RTOS. The number of tasks under the control\r
+ * of the RTOS can be determined using the uxTaskGetNumberOfTasks() API function.\r
+ *\r
+ * @param uxArraySize The size of the array pointed to by the pxTaskStatusArray\r
+ * parameter. The size is specified as the number of indexes in the array, or\r
+ * the number of TaskStatus_t structures contained in the array, not by the\r
+ * number of bytes in the array.\r
+ *\r
+ * @param pulTotalRunTime If configGENERATE_RUN_TIME_STATS is set to 1 in\r
+ * FreeRTOSConfig.h then *pulTotalRunTime is set by uxTaskGetSystemState() to the\r
+ * total run time (as defined by the run time stats clock, see\r
+ * http://www.freertos.org/rtos-run-time-stats.html) since the target booted.\r
+ * pulTotalRunTime can be set to NULL to omit the total run time information.\r
+ *\r
+ * @return The number of TaskStatus_t structures that were populated by\r
+ * uxTaskGetSystemState(). This should equal the number returned by the\r
+ * uxTaskGetNumberOfTasks() API function, but will be zero if the value passed\r
+ * in the uxArraySize parameter was too small.\r
+ *\r
+ * Example usage:\r
+ <pre>\r
+ // This example demonstrates how a human readable table of run time stats\r
+ // information is generated from raw data provided by uxTaskGetSystemState().\r
+ // The human readable table is written to pcWriteBuffer\r
+ void vTaskGetRunTimeStats( char *pcWriteBuffer )\r
+ {\r
+ TaskStatus_t *pxTaskStatusArray;\r
+ volatile UBaseType_t uxArraySize, x;\r
+ uint32_t ulTotalRunTime, ulStatsAsPercentage;\r
+\r
+ // Make sure the write buffer does not contain a string.\r
+ *pcWriteBuffer = 0x00;\r
+\r
+ // Take a snapshot of the number of tasks in case it changes while this\r
+ // function is executing.\r
+ uxArraySize = uxTaskGetNumberOfTasks();\r
+\r
+ // Allocate a TaskStatus_t structure for each task. An array could be\r
+ // allocated statically at compile time.\r
+ pxTaskStatusArray = pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) );\r
+\r
+ if( pxTaskStatusArray != NULL )\r
+ {\r
+ // Generate raw status information about each task.\r
+ uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalRunTime );\r
+\r
+ // For percentage calculations.\r
+ ulTotalRunTime /= 100UL;\r
+\r
+ // Avoid divide by zero errors.\r
+ if( ulTotalRunTime > 0 )\r
+ {\r
+ // For each populated position in the pxTaskStatusArray array,\r
+ // format the raw data as human readable ASCII data\r
+ for( x = 0; x < uxArraySize; x++ )\r
+ {\r
+ // What percentage of the total run time has the task used?\r
+ // This will always be rounded down to the nearest integer.\r
+ // ulTotalRunTimeDiv100 has already been divided by 100.\r
+ ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalRunTime;\r
+\r
+ if( ulStatsAsPercentage > 0UL )\r
+ {\r
+ sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );\r
+ }\r
+ else\r
+ {\r
+ // If the percentage is zero here then the task has\r
+ // consumed less than 1% of the total run time.\r
+ sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter );\r
+ }\r
+\r
+ pcWriteBuffer += strlen( ( char * ) pcWriteBuffer );\r
+ }\r
+ }\r
+\r
+ // The array is no longer needed, free the memory it consumes.\r
+ vPortFree( pxTaskStatusArray );\r
+ }\r
+ }\r
+ </pre>\r
+ */\r
+UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime );\r
+\r
+/**\r
+ * task. h\r
+ * <PRE>void vTaskList( char *pcWriteBuffer );</PRE>\r
+ *\r
+ * configUSE_TRACE_FACILITY and configUSE_STATS_FORMATTING_FUNCTIONS must\r
+ * both be defined as 1 for this function to be available. See the\r
+ * configuration section of the FreeRTOS.org website for more information.\r
+ *\r
+ * NOTE 1: This function will disable interrupts for its duration. It is\r
+ * not intended for normal application runtime use but as a debug aid.\r
+ *\r
+ * Lists all the current tasks, along with their current state and stack\r
+ * usage high water mark.\r
+ *\r
+ * Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or\r
+ * suspended ('S').\r
+ *\r
+ * PLEASE NOTE:\r
+ *\r
+ * This function is provided for convenience only, and is used by many of the\r
+ * demo applications. Do not consider it to be part of the scheduler.\r
+ *\r
+ * vTaskList() calls uxTaskGetSystemState(), then formats part of the\r
+ * uxTaskGetSystemState() output into a human readable table that displays task\r
+ * names, states and stack usage.\r
+ *\r
+ * vTaskList() has a dependency on the sprintf() C library function that might\r
+ * bloat the code size, use a lot of stack, and provide different results on\r
+ * different platforms. An alternative, tiny, third party, and limited\r
+ * functionality implementation of sprintf() is provided in many of the\r
+ * FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note\r
+ * printf-stdarg.c does not provide a full snprintf() implementation!).\r
+ *\r
+ * It is recommended that production systems call uxTaskGetSystemState()\r
+ * directly to get access to raw stats data, rather than indirectly through a\r
+ * call to vTaskList().\r
+ *\r
+ * @param pcWriteBuffer A buffer into which the above mentioned details\r
+ * will be written, in ASCII form. This buffer is assumed to be large\r
+ * enough to contain the generated report. Approximately 40 bytes per\r
+ * task should be sufficient.\r
+ *\r
+ * \defgroup vTaskList vTaskList\r
+ * \ingroup TaskUtils\r
+ */\r
+void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+\r
+/**\r
+ * task. h\r
+ * <PRE>void vTaskGetRunTimeStats( char *pcWriteBuffer );</PRE>\r
+ *\r
+ * configGENERATE_RUN_TIME_STATS and configUSE_STATS_FORMATTING_FUNCTIONS\r
+ * must both be defined as 1 for this function to be available. The application\r
+ * must also then provide definitions for\r
+ * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE()\r
+ * to configure a peripheral timer/counter and return the timers current count\r
+ * value respectively. The counter should be at least 10 times the frequency of\r
+ * the tick count.\r
+ *\r
+ * NOTE 1: This function will disable interrupts for its duration. It is\r
+ * not intended for normal application runtime use but as a debug aid.\r
+ *\r
+ * Setting configGENERATE_RUN_TIME_STATS to 1 will result in a total\r
+ * accumulated execution time being stored for each task. The resolution\r
+ * of the accumulated time value depends on the frequency of the timer\r
+ * configured by the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() macro.\r
+ * Calling vTaskGetRunTimeStats() writes the total execution time of each\r
+ * task into a buffer, both as an absolute count value and as a percentage\r
+ * of the total system execution time.\r
+ *\r
+ * NOTE 2:\r
+ *\r
+ * This function is provided for convenience only, and is used by many of the\r
+ * demo applications. Do not consider it to be part of the scheduler.\r
+ *\r
+ * vTaskGetRunTimeStats() calls uxTaskGetSystemState(), then formats part of the\r
+ * uxTaskGetSystemState() output into a human readable table that displays the\r
+ * amount of time each task has spent in the Running state in both absolute and\r
+ * percentage terms.\r
+ *\r
+ * vTaskGetRunTimeStats() has a dependency on the sprintf() C library function\r
+ * that might bloat the code size, use a lot of stack, and provide different\r
+ * results on different platforms. An alternative, tiny, third party, and\r
+ * limited functionality implementation of sprintf() is provided in many of the\r
+ * FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note\r
+ * printf-stdarg.c does not provide a full snprintf() implementation!).\r
+ *\r
+ * It is recommended that production systems call uxTaskGetSystemState() directly\r
+ * to get access to raw stats data, rather than indirectly through a call to\r
+ * vTaskGetRunTimeStats().\r
+ *\r
+ * @param pcWriteBuffer A buffer into which the execution times will be\r
+ * written, in ASCII form. This buffer is assumed to be large enough to\r
+ * contain the generated report. Approximately 40 bytes per task should\r
+ * be sufficient.\r
+ *\r
+ * \defgroup vTaskGetRunTimeStats vTaskGetRunTimeStats\r
+ * \ingroup TaskUtils\r
+ */\r
+void vTaskGetRunTimeStats( char *pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r