-/*\r
- * Macros and private variables used by the trace facility.\r
- */\r
-#if ( configUSE_TRACE_FACILITY == 1 )\r
-\r
- #define tskSIZE_OF_EACH_TRACE_LINE ( ( unsigned long ) ( sizeof( unsigned long ) + sizeof( unsigned long ) ) )\r
- PRIVILEGED_DATA static volatile signed char * volatile pcTraceBuffer;\r
- PRIVILEGED_DATA static signed char *pcTraceBufferStart;\r
- PRIVILEGED_DATA static signed char *pcTraceBufferEnd;\r
- PRIVILEGED_DATA static signed portBASE_TYPE xTracing = pdFALSE;\r
- static unsigned portBASE_TYPE uxPreviousTask = 255U;\r
- PRIVILEGED_DATA static char pcStatusString[ 50 ];\r
-\r
-#endif\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-/*\r
- * Macro that writes a trace of scheduler activity to a buffer. This trace\r
- * shows which task is running when and is very useful as a debugging tool.\r
- * As this macro is called each context switch it is a good idea to undefine\r
- * it if not using the facility.\r
- */\r
-#if ( configUSE_TRACE_FACILITY == 1 )\r
-\r
- #define vWriteTraceToBuffer() \\r
- { \\r
- if( xTracing != pdFALSE ) \\r
- { \\r
- if( uxPreviousTask != pxCurrentTCB->uxTCBNumber ) \\r
- { \\r
- if( ( pcTraceBuffer + tskSIZE_OF_EACH_TRACE_LINE ) < pcTraceBufferEnd ) \\r
- { \\r
- uxPreviousTask = pxCurrentTCB->uxTCBNumber; \\r
- *( unsigned long * ) pcTraceBuffer = ( unsigned long ) xTickCount; \\r
- pcTraceBuffer += sizeof( unsigned long ); \\r
- *( unsigned long * ) pcTraceBuffer = ( unsigned long ) uxPreviousTask; \\r
- pcTraceBuffer += sizeof( unsigned long ); \\r
- } \\r
- else \\r
- { \\r
- xTracing = pdFALSE; \\r
- } \\r
- } \\r
- } \\r
- }\r
-\r
-#else\r
-\r
- #define vWriteTraceToBuffer()\r
-\r
-#endif\r