From: richardbarry Date: Mon, 23 Nov 2009 10:43:04 +0000 (+0000) Subject: vTaskList() now works for architectures where the stack grows up from low memory. X-Git-Tag: V6.0.3~46 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=52c74db772bde03604d0d937b5f897c05f49dffd;p=freertos vTaskList() now works for architectures where the stack grows up from low memory. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@940 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/tasks.c b/Source/tasks.c index c16efb1b6..3cd2e9c02 100644 --- a/Source/tasks.c +++ b/Source/tasks.c @@ -2040,7 +2040,16 @@ tskTCB *pxNewTCB; do { listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList ); - usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack ); + #if ( portSTACK_GROWTH > 0 ) + { + usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxEndOfStack ); + } + #else + { + usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack ); + } + #endif + 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 ); strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatusString );