]> git.sur5r.net Git - freertos/blobdiff - Source/tasks.c
Change "SWI" to "SWI 0".
[freertos] / Source / tasks.c
index c16efb1b65d58de3f17b603dbed2c05fb8052681..6a78a5c0e2abcf4101796897729999e499e36210 100644 (file)
@@ -1744,7 +1744,7 @@ portBASE_TYPE xReturn;
                        passed since vTaskSetTimeout() was called. */\r
                        xReturn = pdTRUE;\r
                }\r
-               else if( ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering ) < ( portTickType ) *pxTicksToWait )\r
+               else if( ( ( portTickType ) ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering ) ) < ( portTickType ) *pxTicksToWait )\r
                {\r
                        /* Not a genuine timeout. Adjust parameters for time remaining. */\r
                        *pxTicksToWait -= ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering );\r
@@ -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