]> git.sur5r.net Git - freertos/blobdiff - Source/timers.c
Set the last return address at the bottom of the stack to 0 in the RX600 ports to...
[freertos] / Source / timers.c
index 4cd612b13ec7ecbb52f296d17ad1b2bfd33ecbee..dd77d08108728bedf93804e1d3098b5326b0aa7d 100644 (file)
@@ -1,12 +1,6 @@
 /*\r
-    FreeRTOS V7.0.0 - Copyright (C) 2011 Real Time Engineers Ltd.\r
-       \r
+    FreeRTOS V7.1.0 - Copyright (C) 2011 Real Time Engineers Ltd.\r
 \r
-       FreeRTOS supports many tools and architectures. V7.0.0 is sponsored by:\r
-       Atollic AB - Atollic provides professional embedded systems development \r
-       tools for C/C++ development, code analysis and test automation.  \r
-       See http://www.atollic.com\r
-       \r
 \r
     ***************************************************************************\r
      *                                                                       *\r
@@ -110,6 +104,12 @@ PRIVILEGED_DATA static xList *pxOverflowTimerList;
 /* A queue that is used to send commands to the timer service task. */\r
 PRIVILEGED_DATA static xQueueHandle xTimerQueue = NULL;\r
 \r
+#if ( INCLUDE_xTimerGetTimerDaemonTaskHandle == 1 )\r
+       \r
+       PRIVILEGED_DATA static xTaskHandle xTimerTaskHandle = NULL;\r
+       \r
+#endif\r
+\r
 /*-----------------------------------------------------------*/\r
 \r
 /*\r
@@ -183,7 +183,18 @@ portBASE_TYPE xReturn = pdFAIL;
 \r
        if( xTimerQueue != NULL )\r
        {\r
-               xReturn = xTaskCreate( prvTimerTask, ( const signed char * ) "Tmr Svc", ( unsigned short ) configTIMER_TASK_STACK_DEPTH, NULL, ( unsigned portBASE_TYPE ) configTIMER_TASK_PRIORITY, NULL);\r
+               #if ( INCLUDE_xTimerGetTimerDaemonTaskHandle == 1 )\r
+               {\r
+                       /* Create the timer task, storing its handle in xTimerTaskHandle so\r
+                       it can be returned by the xTimerGetTimerDaemonTaskHandle() function. */\r
+                       xReturn = xTaskCreate( prvTimerTask, ( const signed char * ) "Tmr Svc", ( unsigned short ) configTIMER_TASK_STACK_DEPTH, NULL, ( unsigned portBASE_TYPE ) configTIMER_TASK_PRIORITY, &xTimerTaskHandle );       \r
+               }\r
+               #else\r
+               {\r
+                       /* Create the timer task without storing its handle. */\r
+                       xReturn = xTaskCreate( prvTimerTask, ( const signed char * ) "Tmr Svc", ( unsigned short ) configTIMER_TASK_STACK_DEPTH, NULL, ( unsigned portBASE_TYPE ) configTIMER_TASK_PRIORITY, NULL);\r
+               }\r
+               #endif\r
        }\r
 \r
        configASSERT( xReturn );\r
@@ -230,7 +241,7 @@ xTIMER *pxNewTimer;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, portBASE_TYPE *pxHigherPriorityTaskWoken, portTickType xBlockTime )\r
+portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portTickType xBlockTime )\r
 {\r
 portBASE_TYPE xReturn = pdFAIL;\r
 xTIMER_MESSAGE xMessage;\r
@@ -267,6 +278,19 @@ xTIMER_MESSAGE xMessage;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+#if ( INCLUDE_xTimerGetTimerDaemonTaskHandle == 1 )\r
+\r
+       xTaskHandle xTimerGetTimerDaemonTaskHandle( void )\r
+       {\r
+               /* If xTimerGetTimerDaemonTaskHandle() is called before the scheduler has been\r
+               started, then xTimerTaskHandle will be NULL. */\r
+               configASSERT( ( xTimerTaskHandle != NULL ) );\r
+               return xTimerTaskHandle;\r
+       }\r
+       \r
+#endif\r
+/*-----------------------------------------------------------*/\r
+\r
 static void prvProcessExpiredTimer( portTickType xNextExpireTime, portTickType xTimeNow )\r
 {\r
 xTIMER *pxTimer;\r