From 19c1fcb93bbcb69c3760ec124118306a44ce48f9 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Wed, 30 Jul 2008 09:34:03 +0000 Subject: [PATCH] Ensure statics are handled correctly when portREMOVE_STATIC_QUALIFIER is defined. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@421 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Source/tasks.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Source/tasks.c b/Source/tasks.c index 71e420134..72d66b04e 100644 --- a/Source/tasks.c +++ b/Source/tasks.c @@ -135,6 +135,10 @@ static volatile unsigned portBASE_TYPE uxSchedulerSuspended = ( unsigned portBA static volatile unsigned portBASE_TYPE uxMissedTicks = ( unsigned portBASE_TYPE ) 0; static volatile portBASE_TYPE xMissedYield = ( portBASE_TYPE ) pdFALSE; static volatile portBASE_TYPE xNumOfOverflows = ( portBASE_TYPE ) 0; +#if ( configUSE_TRACE_FACILITY == 1 ) + static unsigned portBASE_TYPE uxTaskNumber = 0; /*lint !e956 Static is deliberate - this is guarded before use. */ +#endif + /* Debugging and trace facilities private variables and macros. ------------*/ /* @@ -161,7 +165,8 @@ static volatile portBASE_TYPE xNumOfOverflows = ( portBASE_TYPE ) 0; static signed portCHAR *pcTraceBufferStart; static signed portCHAR *pcTraceBufferEnd; static signed portBASE_TYPE xTracing = pdFALSE; - + static unsigned portBASE_TYPE uxPreviousTask = 255; + static portCHAR pcStatusString[ 50 ]; #endif /*-----------------------------------------------------------*/ @@ -178,8 +183,6 @@ static volatile portBASE_TYPE xNumOfOverflows = ( portBASE_TYPE ) 0; { \ if( xTracing ) \ { \ - static unsigned portBASE_TYPE uxPreviousTask = 255; \ - \ if( uxPreviousTask != pxCurrentTCB->uxTCBNumber ) \ { \ if( ( pcTraceBuffer + tskSIZE_OF_EACH_TRACE_LINE ) < pcTraceBufferEnd ) \ @@ -423,9 +426,6 @@ signed portBASE_TYPE xTaskCreate( pdTASK_CODE pvTaskCode, const signed portCHAR { signed portBASE_TYPE xReturn; tskTCB * pxNewTCB; -#if ( configUSE_TRACE_FACILITY == 1 ) - static unsigned portBASE_TYPE uxTaskNumber = 0; /*lint !e956 Static is deliberate - this is guarded before use. */ -#endif /* Allocate the memory required by the TCB and stack for the new task. checking that the allocation was successful. */ @@ -1877,7 +1877,6 @@ tskTCB *pxNewTCB; static void prvListTaskWithinSingleList( const signed portCHAR *pcWriteBuffer, xList *pxList, signed portCHAR cStatus ) { volatile tskTCB *pxNextTCB, *pxFirstTCB; - static portCHAR pcStatusString[ 50 ]; unsigned portSHORT usStackRemaining; /* Write the details of all the TCB's in pxList into the buffer. */ -- 2.39.2