]> git.sur5r.net Git - freertos/commitdiff
vTaskList() now works for architectures where the stack grows up from low memory.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 23 Nov 2009 10:43:04 +0000 (10:43 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 23 Nov 2009 10:43:04 +0000 (10:43 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@940 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/tasks.c

index c16efb1b65d58de3f17b603dbed2c05fb8052681..3cd2e9c02297e46896292abf69e4b8d9b213d1be 100644 (file)
@@ -2040,7 +2040,16 @@ tskTCB *pxNewTCB;
                do\r
                {\r
                        listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );\r
-                       usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack );\r
+                       #if ( portSTACK_GROWTH > 0 )\r
+                       {\r
+                               usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxEndOfStack );\r
+                       }\r
+                       #else\r
+                       {\r
+                               usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack );\r
+                       }\r
+                       #endif                  \r
+                       \r
                        sprintf( pcStatusString, ( char * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );\r
                        strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatusString );\r
 \r