mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-06-06 12:29:03 -04:00
Added some trace macros into the timers.c file.
This commit is contained in:
parent
afe9c0face
commit
0e62058edb
|
@ -408,6 +408,26 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
|
||||||
#define traceTASK_INCREMENT_TICK( xTickCount )
|
#define traceTASK_INCREMENT_TICK( xTickCount )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceTIMER_CREATE
|
||||||
|
#define traceTIMER_CREATE( pxNewTimer )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceTIMER_CREATE_FAILED
|
||||||
|
#define traceTIMER_CREATE_FAILED()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceTIMER_COMMAND_SEND
|
||||||
|
#define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceTIMER_EXPIRED
|
||||||
|
#define traceTIMER_EXPIRED( pxTimer )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceTIMER_COMMAND_RECEIVED
|
||||||
|
#define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef configGENERATE_RUN_TIME_STATS
|
#ifndef configGENERATE_RUN_TIME_STATS
|
||||||
#define configGENERATE_RUN_TIME_STATS 0
|
#define configGENERATE_RUN_TIME_STATS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -180,6 +180,7 @@ portBASE_TYPE xReturn = pdFAIL;
|
||||||
xReturn = xTaskCreate( prvTimerTask, ( const signed char * ) "Tmr Svc", configTIMER_TASK_STACK_DEPTH, NULL, configTIMER_TASK_PRIORITY, NULL);
|
xReturn = xTaskCreate( prvTimerTask, ( const signed char * ) "Tmr Svc", configTIMER_TASK_STACK_DEPTH, NULL, configTIMER_TASK_PRIORITY, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configASSERT( xReturn );
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -203,8 +204,6 @@ xTIMER *pxNewTimer;
|
||||||
created/initialised. */
|
created/initialised. */
|
||||||
prvCheckForValidListAndQueue();
|
prvCheckForValidListAndQueue();
|
||||||
|
|
||||||
configASSERT( ( xTimerPeriodInTicks > 0 ) );
|
|
||||||
|
|
||||||
/* Initialise the timer structure members using the function parameters. */
|
/* Initialise the timer structure members using the function parameters. */
|
||||||
pxNewTimer->pcTimerName = pcTimerName;
|
pxNewTimer->pcTimerName = pcTimerName;
|
||||||
pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;
|
pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;
|
||||||
|
@ -212,6 +211,12 @@ xTIMER *pxNewTimer;
|
||||||
pxNewTimer->pvTimerID = pvTimerID;
|
pxNewTimer->pvTimerID = pvTimerID;
|
||||||
pxNewTimer->pxCallbackFunction = pxCallbackFunction;
|
pxNewTimer->pxCallbackFunction = pxCallbackFunction;
|
||||||
vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );
|
vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );
|
||||||
|
|
||||||
|
traceTIMER_CREATE( pxNewTimer );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
traceTIMER_CREATE_FAILED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,6 +253,8 @@ xTIMER_MESSAGE xMessage;
|
||||||
{
|
{
|
||||||
xReturn = xQueueSendToBackFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );
|
xReturn = xQueueSendToBackFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
traceTIMER_COMMAND_SEND( xTimer, xCommandID, xOptionalValue, xReturn );
|
||||||
}
|
}
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
|
@ -263,6 +270,7 @@ portBASE_TYPE xResult;
|
||||||
been performed to ensure the list is not empty. */
|
been performed to ensure the list is not empty. */
|
||||||
pxTimer = ( xTIMER * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList );
|
pxTimer = ( xTIMER * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList );
|
||||||
vListRemove( &( pxTimer->xTimerListItem ) );
|
vListRemove( &( pxTimer->xTimerListItem ) );
|
||||||
|
traceTIMER_EXPIRED( pxTimer );
|
||||||
|
|
||||||
/* If the timer is an auto reload timer then calculate the next
|
/* If the timer is an auto reload timer then calculate the next
|
||||||
expiry time and re-insert the timer in the list of active timers. */
|
expiry time and re-insert the timer in the list of active timers. */
|
||||||
|
@ -479,6 +487,8 @@ portTickType xTimeNow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
traceTIMER_COMMAND_RECEIVED( pxTimer, xMessage.xMessageID, xMessage.xMessageValue );
|
||||||
|
|
||||||
switch( xMessage.xMessageID )
|
switch( xMessage.xMessageID )
|
||||||
{
|
{
|
||||||
case tmrCOMMAND_START :
|
case tmrCOMMAND_START :
|
||||||
|
|
Loading…
Reference in a new issue