CC32xx/FreeRTOS_Trace.c
void	vTrace(uint32_t trcCode, void * P1, uint32_t P2) {
	if ((TraceTask == NULL) ||							// not yet initialised ?
		(TraceFlag & flagTRACE_ENABLED) == 0 ||			// tracing not enabled ?
		(TraceTask == TaskTrace)) {						// tracing the trace task ?
		return ;										// ...skip out
	}
	pTrcIn->ts		= xRtosStatsTimerValue ;			// freeze the time stamp ASAP
	if (trcCode <= trcCODE_TaD) {
		pTrcIn->task	= P1 ;							// Task context is the specified task
	} else {
		pTrcIn->task	= TraceTask ;					// Task context is current task handle...
	}
	pTrcIn->code	= trcCode ;
	pTrcIn->P1		= P1 ;
	pTrcIn->P2		= P2 ;
	pTrcIn++ ;
	if (pTrcIn == &TrcBuf[configTRACE_BUFSIZE]) {
		pTrcIn = &TrcBuf[0] ;
	}
	if (pTrcIn == pTrcOut) {
		pTrcOut++ ;
		if (pTrcOut == &TrcBuf[configTRACE_BUFSIZE]) {
			pTrcOut = &TrcBuf[0] ;
		}
	}
}
/*
 * vTrace() - translate trace event info and store into buffer
 */
translate trace event info and store into buffer
translate trace event info and store into buffer
void	vTrace(uint32_t trcCode, void * P1, uint32_t P2) {
	if ((TraceTask == NULL) ||							
		(TraceFlag & flagTRACE_ENABLED) == 0 ||			
		(TraceTask == TaskTrace)) {						
		return ;										
	}
	pTrcIn->ts		= xRtosStatsTimerValue ;			
	if (trcCode <= trcCODE_TaD) {
		pTrcIn->task	= P1 ;							
	} else {
		pTrcIn->task	= TraceTask ;					
	}
	pTrcIn->code	= trcCode ;
	pTrcIn->P1		= P1 ;
	pTrcIn->P2		= P2 ;
	pTrcIn++ ;
	if (pTrcIn == &TrcBuf[configTRACE_BUFSIZE]) {
		pTrcIn = &TrcBuf[0] ;
	}
	if (pTrcIn == pTrcOut) {
		pTrcOut++ ;
		if (pTrcOut == &TrcBuf[configTRACE_BUFSIZE]) {
			pTrcOut = &TrcBuf[0] ;
		}
	}
}
void vTrace ( uint32_t trcCode , void * P1 , uint32_t P2 ) { if ( ( TraceTask == NULL ) || ( TraceFlag & flagTRACE_ENABLED ) == 0 || ( TraceTask == TaskTrace ) ) { return ; } pTrcIn -> ts = xRtosStatsTimerValue ; if ( trcCode <= trcCODE_TaD ) { pTrcIn -> task = P1 ; } else { pTrcIn -> task = TraceTask ; } pTrcIn -> code = trcCode ; pTrcIn -> P1 = P1 ; pTrcIn -> P2 = P2 ; pTrcIn ++ ; if ( pTrcIn == & TrcBuf [ configTRACE_BUFSIZE ] ) { pTrcIn = & TrcBuf [ 0 ] ; } if ( pTrcIn == pTrcOut ) { pTrcOut ++ ; if ( pTrcOut == & TrcBuf [ configTRACE_BUFSIZE ] ) { pTrcOut = & TrcBuf [ 0 ] ; } } }
vTrace() - translate trace event info and store into buffer
vTrace () - translate trace event info and store into buffer
// not yet initialised ? // tracing not enabled ? // tracing the trace task ? // ...skip out // freeze the time stamp ASAP // Task context is the specified task // Task context is current task handle...