+#if ( configUSE_APPLICATION_TASK_TAG == 1 )\r
+\r
+ pdTASK_HOOK_CODE xTaskGetApplicationTaskTag( xTaskHandle xTask )\r
+ {\r
+ tskTCB *xTCB;\r
+ pdTASK_HOOK_CODE xReturn;\r
+\r
+ /* If xTask is NULL then we are setting our own task hook. */\r
+ if( xTask == NULL )\r
+ {\r
+ xTCB = ( tskTCB * ) pxCurrentTCB;\r
+ }\r
+ else\r
+ {\r
+ xTCB = ( tskTCB * ) xTask;\r
+ }\r
+\r
+ /* Save the hook function in the TCB. A critical section is required as\r
+ the value can be accessed from an interrupt. */\r
+ portENTER_CRITICAL();\r
+ xReturn = xTCB->pxTaskTag;\r
+ portEXIT_CRITICAL();\r
+ \r
+ return xReturn;\r
+ }\r
+\r
+#endif\r
+/*-----------------------------------------------------------*/\r
+\r