+\r
+ /* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and \r
+ xTaskGetIdleTaskHandle() functions. Also try using the function that sets\r
+ the task number. */\r
+ xIdleTaskHandle = xTaskGetIdleTaskHandle();\r
+ xTimerTaskHandle = xTimerGetTimerDaemonTaskHandle();\r
+ vTaskSetTaskNumber( xIdleTaskHandle, ( unsigned long ) ucConstTaskNumber );\r
+ configASSERT( uxTaskGetTaskNumber( xIdleTaskHandle ) == ucConstTaskNumber );\r
+\r
+ /* This is the idle hook, so the current task handle should equal the \r
+ returned idle task handle. */\r
+ if( xTaskGetCurrentTaskHandle() != xIdleTaskHandle )\r
+ {\r
+ pcStatusMessage = "Error: Returned idle task handle was incorrect";\r
+ }\r
+\r
+ /* Check the timer task handle was returned correctly. */\r
+ pcTaskName = pcTaskGetTaskName( xTimerTaskHandle );\r
+ if( strcmp( pcTaskName, "Tmr Svc" ) != 0 )\r
+ {\r
+ pcStatusMessage = "Error: Returned timer task handle was incorrect";\r
+ }\r
+\r
+ /* If xMutexToDelete has not already been deleted, then delete it now.\r
+ This is done purely to demonstrate the use of, and test, the \r
+ vSemaphoreDelete() macro. Care must be taken not to delete a semaphore\r
+ that has tasks blocked on it. */\r
+ if( xMutexToDelete != NULL )\r
+ {\r
+ /* Before deleting the semaphore, test the function used to set its\r
+ number. This would normally only be done from trace software, rather\r
+ than application code. */\r
+ vQueueSetQueueNumber( xMutexToDelete, ucConstQueueNumber );\r
+\r
+ /* Before deleting the semaphore, test the functions used to get its\r
+ type and number. Again, these would normally only be done from trace\r
+ software, rather than application code. */\r
+ configASSERT( ucQueueGetQueueNumber( xMutexToDelete ) == ucConstQueueNumber );\r
+ configASSERT( ucQueueGetQueueType( xMutexToDelete ) == queueQUEUE_TYPE_MUTEX );\r
+ vSemaphoreDelete( xMutexToDelete );\r
+ xMutexToDelete = NULL;\r
+ }\r