From: rtel Date: Mon, 7 Jan 2019 19:40:13 +0000 (+0000) Subject: Update main.c() for the WIN32-MingW project so the trace recorder is initialized... X-Git-Tag: V10.2.0~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f5c441f4346a651d78822121dadd1afc132cad78;p=freertos Update main.c() for the WIN32-MingW project so the trace recorder is initialized even when the simple blinky demo is used - otherwise the trace recorder causes an exception as it is used without first being initialized. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2623 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Demo/WIN32-MingW/main.c b/FreeRTOS/Demo/WIN32-MingW/main.c index 0cbca3855..62f9aa563 100644 --- a/FreeRTOS/Demo/WIN32-MingW/main.c +++ b/FreeRTOS/Demo/WIN32-MingW/main.c @@ -141,6 +141,21 @@ int main( void ) http://www.freertos.org/a00111.html for an explanation. */ prvInitialiseHeap(); + /* Do not include trace code when performing a code coverage analysis. */ + #if( projCOVERAGE_TEST != 1 ) + { + /* Initialise the trace recorder. Use of the trace recorder is optional. + See http://www.FreeRTOS.org/trace for more information. */ + vTraceEnable( TRC_START ); + + /* Start the trace recording - the recording is written to a file if + configASSERT() is called. */ + printf( "\r\nTrace started.\r\nThe trace will be dumped to disk if a call to configASSERT() fails.\r\n" ); + printf( "Uncomment the call to kbhit() in this file to also dump trace with a key press.\r\n" ); + uiTraceStart(); + } + #endif + /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top of this file. */ #if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 ) @@ -149,21 +164,6 @@ int main( void ) } #else { - /* Do not include trace code when performing a code coverage analysis. */ - #if( projCOVERAGE_TEST != 1 ) - { - /* Initialise the trace recorder. Use of the trace recorder is optional. - See http://www.FreeRTOS.org/trace for more information. */ - vTraceEnable( TRC_START ); - - /* Start the trace recording - the recording is written to a file if - configASSERT() is called. */ - printf( "\r\nTrace started.\r\nThe trace will be dumped to disk if a call to configASSERT() fails.\r\n" ); - printf( "Uncomment the call to kbhit() in this file to also dump trace with a key press.\r\n" ); - uiTraceStart(); - } - #endif - main_full(); } #endif