]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/timers.c
Remove compiler warning by ensure prvInitialiseMutex() is not included if configUSE_M...
[freertos] / FreeRTOS / Source / timers.c
index 6e5a341aa40fe1e6886de28f0af25204155b6b74..96d22615d5e2f749a3fc19a7eeafb7c5101b43ee 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V9.0.0rc1 - Copyright (C) 2016 Real Time Engineers Ltd.\r
+    FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -183,7 +183,7 @@ PRIVILEGED_DATA static TaskHandle_t xTimerTaskHandle = NULL;
        following callback function - which enables the application to optionally\r
        provide the memory that will be used by the timer task as the task's stack\r
        and TCB. */\r
-       extern void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint16_t *pusTimerTaskStackSize );\r
+       extern void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize );\r
 \r
 #endif\r
 \r
@@ -254,8 +254,6 @@ static void prvInitialiseNewTimer( const char * const pcTimerName, const TickTyp
 BaseType_t xTimerCreateTimerTask( void )\r
 {\r
 BaseType_t xReturn = pdFAIL;\r
-uint16_t usTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;\r
-\r
 \r
        /* This function is called when the scheduler is started if\r
        configUSE_TIMERS is set to 1.  Check that the infrastructure used by the\r
@@ -270,13 +268,19 @@ uint16_t usTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
                {\r
                        StaticTask_t *pxTimerTaskTCBBuffer = NULL;\r
                        StackType_t *pxTimerTaskStackBuffer = NULL;\r
+                       uint32_t ulTimerTaskStackSize;\r
+\r
+                       vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &ulTimerTaskStackSize );\r
+                       xTimerTaskHandle = xTaskCreateStatic( prvTimerTask, "Tmr Svc", ulTimerTaskStackSize, NULL, ( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, pxTimerTaskStackBuffer, pxTimerTaskTCBBuffer );\r
 \r
-                       vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &usTimerTaskStackSize );\r
-                       xReturn = xTaskCreateStatic( prvTimerTask, "Tmr Svc", usTimerTaskStackSize, NULL, ( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, &xTimerTaskHandle, pxTimerTaskStackBuffer, pxTimerTaskTCBBuffer );\r
+                       if( xTimerTaskHandle != NULL )\r
+                       {\r
+                               xReturn = pdPASS;\r
+                       }\r
                }\r
                #else\r
                {\r
-                       xReturn = xTaskCreate( prvTimerTask, "Tmr Svc", usTimerTaskStackSize, NULL, ( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, &xTimerTaskHandle );\r
+                       xReturn = xTaskCreate( prvTimerTask, "Tmr Svc", configTIMER_TASK_STACK_DEPTH, NULL, ( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, &xTimerTaskHandle );\r
                }\r
                #endif /* configSUPPORT_STATIC_ALLOCATION */\r
        }\r
@@ -433,7 +437,27 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-const char * pcTimerGetTimerName( TimerHandle_t xTimer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+TickType_t xTimerGetPeriod( TimerHandle_t xTimer )\r
+{\r
+Timer_t *pxTimer = ( Timer_t * ) xTimer;\r
+\r
+       configASSERT( xTimer );\r
+       return pxTimer->xTimerPeriodInTicks;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer )\r
+{\r
+Timer_t * pxTimer = ( Timer_t * ) xTimer;\r
+TickType_t xReturn;\r
+\r
+       configASSERT( xTimer );\r
+       xReturn = listGET_LIST_ITEM_VALUE( &( pxTimer->xTimerListItem ) );\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+const char * pcTimerGetName( TimerHandle_t xTimer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
 {\r
 Timer_t *pxTimer = ( Timer_t * ) xTimer;\r
 \r