/*\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
* Creates a new software timer instance, and returns a handle by which the\r
* created software timer can be referenced.\r
*\r
- * Internally, within the FreeRTOS implementation, software timer's use a block\r
+ * Internally, within the FreeRTOS implementation, software timers use a block\r
* of memory, in which the timer data structure is stored. If a software timer\r
* is created using xTimerCreate() then the required memory is automatically\r
* dynamically allocated inside the xTimerCreate() function. (see\r
* http://www.freertos.org/a00111.html). If a software timer is created using\r
- * xTimerCreateStatic() then the application writer can instead optionally\r
- * provide the memory that will get used by the software timer.\r
- * xTimerCreateStatic() therefore allows a software timer to be created without\r
- * using any dynamic memory allocation.\r
+ * xTimerCreateStatic() then the application writer must provide the memory that\r
+ * will get used by the software timer. xTimerCreateStatic() therefore allows a\r
+ * software timer to be created without using any dynamic memory allocation.\r
*\r
* Timers are created in the dormant state. The xTimerStart(), xTimerReset(),\r
* xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and\r
* }\r
* @endverbatim\r
*/\r
-#define xTimerCreate( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction ) xTimerGenericCreate( ( pcTimerName ), ( xTimerPeriodInTicks ), ( uxAutoReload ), ( pvTimerID ), ( pxCallbackFunction ), NULL )\r
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
+ TimerHandle_t xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+#endif\r
\r
/**\r
* TimerHandle_t xTimerCreateStatic(const char * const pcTimerName,\r
* Creates a new software timer instance, and returns a handle by which the\r
* created software timer can be referenced.\r
*\r
- * Internally, within the FreeRTOS implementation, software timer's use a block\r
+ * Internally, within the FreeRTOS implementation, software timers use a block\r
* of memory, in which the timer data structure is stored. If a software timer\r
* is created using xTimerCreate() then the required memory is automatically\r
* dynamically allocated inside the xTimerCreate() function. (see\r
* http://www.freertos.org/a00111.html). If a software timer is created using\r
- * xTimerCreateStatic() then the application writer can instead optionally\r
- * provide the memory that will get used by the software timer.\r
- * xTimerCreateStatic() therefore allows a software to be created without using\r
- * any dynamic memory allocation.\r
+ * xTimerCreateStatic() then the application writer must provide the memory that\r
+ * will get used by the software timer. xTimerCreateStatic() therefore allows a\r
+ * software timer to be created without using any dynamic memory allocation.\r
*\r
* Timers are created in the dormant state. The xTimerStart(), xTimerReset(),\r
* xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and\r
* Callback functions must have the prototype defined by TimerCallbackFunction_t,\r
* which is "void vCallbackFunction( TimerHandle_t xTimer );".\r
*\r
- * @param pxTimerBuffer If pxTimerBuffer is NULL then the memory required to\r
- * hold the software timer's data structure will be allocated dynamically, just\r
- * as when a software timer is created using xTimerCreate(). If pxTimerBuffer\r
- * is not NULL then it must point to a variable of type StaticTimer_t, which\r
+ * @param pxTimerBuffer Must point to a variable of type StaticTimer_t, which\r
* will be then be used to hold the software timer's data structures, removing\r
* the need for the memory to be allocated dynamically.\r
*\r
- * @return If pxTimerBuffer is not NULL then the function will not attempt\r
- * any dynamic memory allocation, and a handle to the created timer will always\r
- * be returned. If pxTimerBuffer is NULL then the function will attempt to\r
- * dynamically allocate the memory required to hold the timer's data structures.\r
- * In this case, if the allocation succeeds then a handle to the created timer\r
- * will be returned, and if the allocation fails NULL will be returned.\r
+ * @return If the timer is created then a handle to the created timer is\r
+ * returned. If pxTimerBuffer was NULL then NULL is returned.\r
*\r
* Example usage:\r
* @verbatim\r
* @endverbatim\r
*/\r
#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
- #define xTimerCreateStatic( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction, pxTimerBuffer ) xTimerGenericCreate( ( pcTimerName ), ( xTimerPeriodInTicks ), ( uxAutoReload ), ( pvTimerID ), ( pxCallbackFunction ), ( pxTimerBuffer ) )\r
+ TimerHandle_t xTimerCreateStatic( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction, StaticTimer_t *pxTimerBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
#endif /* configSUPPORT_STATIC_ALLOCATION */\r
\r
/**\r
/**\r
* TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );\r
*\r
- * xTimerGetTimerDaemonTaskHandle() is only available if\r
- * INCLUDE_xTimerGetTimerDaemonTaskHandle is set to 1 in FreeRTOSConfig.h.\r
- *\r
* Simply returns the handle of the timer service/daemon task. It it not valid\r
* to call xTimerGetTimerDaemonTaskHandle() before the scheduler has been started.\r
*/\r
BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
\r
/**\r
- * const char * const pcTimerGetTimerName( TimerHandle_t xTimer );\r
+ * const char * const pcTimerGetName( TimerHandle_t xTimer );\r
*\r
* Returns the name that was assigned to a timer when the timer was created.\r
*\r
*\r
* @return The name assigned to the timer specified by the xTimer parameter.\r
*/\r
-const char * pcTimerGetTimerName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+\r
+/**\r
+ * TickType_t xTimerGetPeriod( TimerHandle_t xTimer );\r
+ *\r
+ * Returns the period of a timer.\r
+ *\r
+ * @param xTimer The handle of the timer being queried.\r
+ *\r
+ * @return The period of the timer in ticks.\r
+ */\r
+TickType_t xTimerGetPeriod( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;\r
+\r
+/**\r
+* TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer );\r
+*\r
+* Returns the time in ticks at which the timer will expire. If this is less\r
+* than the current tick count then the expiry time has overflowed from the\r
+* current time.\r
+*\r
+* @param xTimer The handle of the timer being queried.\r
+*\r
+* @return If the timer is running then the time in ticks at which the timer\r
+* will next expire is returned. If the timer is not running then the return\r
+* value is undefined.\r
+*/\r
+TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* Functions beyond this part are not part of the public API and are intended\r
*/\r
BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;\r
BaseType_t xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
-TimerHandle_t xTimerGenericCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction, StaticTimer_t *pxTimerBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
\r
#ifdef __cplusplus\r
}\r