+#endif /* ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 ) ) */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 )\r
+\r
+ /* uxTaskGetStackHighWaterMark() and uxTaskGetStackHighWaterMark2() are the\r
+ same except for their return type. Using configSTACK_DEPTH_TYPE allows the\r
+ user to determine the return type. It gets around the problem of the value\r
+ overflowing on 8-bit types without breaking backward compatibility for\r
+ applications that expect an 8-bit return type. */\r
+ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask )\r
+ {\r
+ TCB_t *pxTCB;\r
+ uint8_t *pucEndOfStack;\r
+ configSTACK_DEPTH_TYPE uxReturn;\r
+\r
+ /* uxTaskGetStackHighWaterMark() and uxTaskGetStackHighWaterMark2() are\r
+ the same except for their return type. Using configSTACK_DEPTH_TYPE\r
+ allows the user to determine the return type. It gets around the\r
+ problem of the value overflowing on 8-bit types without breaking\r
+ backward compatibility for applications that expect an 8-bit return\r
+ type. */\r
+\r
+ pxTCB = prvGetTCBFromHandle( xTask );\r
+\r
+ #if portSTACK_GROWTH < 0\r
+ {\r
+ pucEndOfStack = ( uint8_t * ) pxTCB->pxStack;\r
+ }\r
+ #else\r
+ {\r
+ pucEndOfStack = ( uint8_t * ) pxTCB->pxEndOfStack;\r
+ }\r
+ #endif\r
+\r
+ uxReturn = prvTaskCheckFreeStackSpace( pucEndOfStack );\r
+\r
+ return uxReturn;\r
+ }\r
+\r
+#endif /* INCLUDE_uxTaskGetStackHighWaterMark2 */\r