]> git.sur5r.net Git - freertos/commitdiff
Added some trace macros into the timers.c file.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 1 Apr 2011 18:45:44 +0000 (18:45 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 1 Apr 2011 18:45:44 +0000 (18:45 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1337 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/include/FreeRTOS.h
Source/timers.c

index b19fbaeba3bd5c191a55d78d1c6be60a3ab87034..cbaf57b4816a398f8a871cda2914cd34d27199b9 100644 (file)
@@ -408,6 +408,26 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
        #define traceTASK_INCREMENT_TICK( xTickCount )\r
 #endif\r
 \r
+#ifndef traceTIMER_CREATE\r
+       #define traceTIMER_CREATE( pxNewTimer )\r
+#endif\r
+\r
+#ifndef traceTIMER_CREATE_FAILED\r
+       #define traceTIMER_CREATE_FAILED()\r
+#endif\r
+\r
+#ifndef traceTIMER_COMMAND_SEND\r
+       #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )\r
+#endif\r
+\r
+#ifndef traceTIMER_EXPIRED\r
+       #define traceTIMER_EXPIRED( pxTimer )\r
+#endif\r
+\r
+#ifndef traceTIMER_COMMAND_RECEIVED\r
+       #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )\r
+#endif\r
+\r
 #ifndef configGENERATE_RUN_TIME_STATS\r
        #define configGENERATE_RUN_TIME_STATS 0\r
 #endif\r
index fc0a70984d970126dea768846f8dc4a501f3dd79..62c8c318aababb0de24c99590206419c1c52e1e4 100644 (file)
@@ -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);\r
        }\r
 \r
+       configASSERT( xReturn );\r
        return xReturn;\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -203,8 +204,6 @@ xTIMER *pxNewTimer;
                        created/initialised. */\r
                        prvCheckForValidListAndQueue();\r
        \r
-                       configASSERT( ( xTimerPeriodInTicks > 0 ) );\r
-       \r
                        /* Initialise the timer structure members using the function parameters. */\r
                        pxNewTimer->pcTimerName = pcTimerName;\r
                        pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;\r
@@ -212,6 +211,12 @@ xTIMER *pxNewTimer;
                        pxNewTimer->pvTimerID = pvTimerID;\r
                        pxNewTimer->pxCallbackFunction = pxCallbackFunction;\r
                        vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );\r
+                       \r
+                       traceTIMER_CREATE( pxNewTimer );\r
+               }\r
+               else\r
+               {\r
+                       traceTIMER_CREATE_FAILED();\r
                }\r
        }\r
        \r
@@ -248,6 +253,8 @@ xTIMER_MESSAGE xMessage;
                {\r
                        xReturn = xQueueSendToBackFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );\r
                }\r
+               \r
+               traceTIMER_COMMAND_SEND( xTimer, xCommandID, xOptionalValue, xReturn );\r
        }\r
        \r
        return xReturn;\r
@@ -263,6 +270,7 @@ portBASE_TYPE xResult;
        been performed to ensure the list is not empty. */\r
        pxTimer = ( xTIMER * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList );\r
        vListRemove( &( pxTimer->xTimerListItem ) );\r
+       traceTIMER_EXPIRED( pxTimer );\r
 \r
        /* If the timer is an auto reload timer then calculate the next\r
        expiry time and re-insert the timer in the list of active timers. */\r
@@ -479,6 +487,8 @@ portTickType xTimeNow;
                        }\r
                }\r
 \r
+               traceTIMER_COMMAND_RECEIVED( pxTimer, xMessage.xMessageID, xMessage.xMessageValue );\r
+               \r
                switch( xMessage.xMessageID )\r
                {\r
                        case tmrCOMMAND_START : \r