From 52c74db772bde03604d0d937b5f897c05f49dffd Mon Sep 17 00:00:00 2001 From: richardbarry Date: Mon, 23 Nov 2009 10:43:04 +0000 Subject: [PATCH] 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 --- Source/tasks.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 ); -- 2.39.5