Skip to content

Commit

Permalink
Remove extra variable 'xTraceRunning' with compile flag for saving trace
Browse files Browse the repository at this point in the history
  • Loading branch information
kar-rahul-aws committed Mar 21, 2024
1 parent e4629ef commit fea74e7
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions FreeRTOS/Demo/Posix_GCC/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,6 @@ static void handle_sigint( int signal );
* in a different file. */
StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];

/* Notes if the trace is running or not. */
#if ( projENABLE_TRACING == 0 )
static BaseType_t xTraceRunning = pdFALSE;
#else /* if ( projENABLE_TRACING == 0 ) */
static BaseType_t xTraceRunning = pdTRUE;
#endif /* if ( projENABLE_TRACING == 0 ) */

static clockid_t cid = CLOCK_THREAD_CPUTIME_ID;

/*-----------------------------------------------------------*/
Expand Down Expand Up @@ -280,10 +273,11 @@ void traceOnEnter()

if( xReturn > 0 )
{
if( xTraceRunning == pdTRUE )
#if ( projENABLE_TRACING == 1 )
{
prvSaveTraceFile();
}
#endif /* if ( projENABLE_TRACING == 1 ) */

/* clear the buffer */
char buffer[ 1 ];
Expand Down Expand Up @@ -333,10 +327,11 @@ void vAssertCalled( const char * const pcFileName,
{
xPrinted = pdTRUE;

if( xTraceRunning == pdTRUE )
#if ( projENABLE_TRACING == 1 )
{
prvSaveTraceFile();
}
#endif /* if ( projENABLE_TRACING == 0 ) */
}

/* You can step out of this function to debug the assertion by using
Expand Down

0 comments on commit fea74e7

Please sign in to comment.