]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/timers.h
Roll up the minor changes checked into svn since V10.0.0 into new V10.0.1 ready for...
[freertos] / FreeRTOS / Source / include / timers.h
index b25144eb09487567d6c2a253e6d15a37b5c5aead..7e2eceb169275f3fb51953c57de0d5e806d211b9 100644 (file)
@@ -1,67 +1,29 @@
 /*\r
-    FreeRTOS V8.0.0:rc1 - Copyright (C) 2014 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that has become a de facto standard.             *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly and support the FreeRTOS         *\r
-     *    project by purchasing a FreeRTOS tutorial book, reference          *\r
-     *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
-     *                                                                       *\r
-     *    Thank you!                                                         *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
-\r
-    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
-    >>! a combined work that includes FreeRTOS without being obliged to provide\r
-    >>! the source code for proprietary components outside of the FreeRTOS\r
-    >>! kernel.\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    1 tab == 4 spaces!\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    Having a problem?  Start by reading the FAQ "My application does   *\r
-     *    not run, what could be wrong?"                                     *\r
-     *                                                                       *\r
-     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
-    license and Real Time Engineers Ltd. contact details.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
-    Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and middleware.\r
-\r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
-    engineered and independently SIL3 certified version for use in safety and\r
-    mission critical applications that require provable dependability.\r
-\r
-    1 tab == 4 spaces!\r
-*/\r
+ * FreeRTOS Kernel V10.0.1\r
+ * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://aws.amazon.com/freertos\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ */\r
 \r
 \r
 #ifndef TIMERS_H\r
        #error "include FreeRTOS.h must appear in source files before include timers.h"\r
 #endif\r
 \r
-/*lint -e537 This headers are only multiply included if the application code\r
+/*lint -save -e537 This headers are only multiply included if the application code\r
 happens to also be including task.h. */\r
 #include "task.h"\r
-/*lint +e956 */\r
+/*lint -restore */\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
@@ -102,6 +64,7 @@ or interrupt version of the queue send function should be used. */
 #define tmrCOMMAND_START_FROM_ISR                              ( ( BaseType_t ) 6 )\r
 #define tmrCOMMAND_RESET_FROM_ISR                              ( ( BaseType_t ) 7 )\r
 #define tmrCOMMAND_STOP_FROM_ISR                               ( ( BaseType_t ) 8 )\r
+#define tmrCOMMAND_CHANGE_PERIOD_FROM_ISR              ( ( BaseType_t ) 9 )\r
 \r
 \r
 /**\r
@@ -130,9 +93,17 @@ typedef void (*PendedFunction_t)( void *, uint32_t );
  *                                                             void * pvTimerID,\r
  *                                                             TimerCallbackFunction_t pxCallbackFunction );\r
  *\r
- * Creates a new software timer instance.  This allocates the storage required\r
- * by the new timer, initialises the new timers internal state, and returns a\r
- * handle by which the new timer can be referenced.\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 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 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
@@ -245,14 +216,151 @@ typedef void (*PendedFunction_t)( void *, uint32_t );
  *\r
  *     // Starting the scheduler will start the timers running as they have already\r
  *     // been set into the active state.\r
- *     xTaskStartScheduler();\r
+ *     vTaskStartScheduler();\r
  *\r
  *     // Should not reach here.\r
  *     for( ;; );\r
  * }\r
  * @endverbatim\r
  */\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
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
+       TimerHandle_t xTimerCreate(     const char * const pcTimerName,                 /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                               const TickType_t xTimerPeriodInTicks,\r
+                                                               const UBaseType_t uxAutoReload,\r
+                                                               void * const pvTimerID,\r
+                                                               TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION;\r
+#endif\r
+\r
+/**\r
+ * TimerHandle_t xTimerCreateStatic(const char * const pcTimerName,\r
+ *                                                                     TickType_t xTimerPeriodInTicks,\r
+ *                                                                     UBaseType_t uxAutoReload,\r
+ *                                                                     void * pvTimerID,\r
+ *                                                                     TimerCallbackFunction_t pxCallbackFunction,\r
+ *                                                                     StaticTimer_t *pxTimerBuffer );\r
+ *\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 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 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
+ * xTimerChangePeriodFromISR() API functions can all be used to transition a\r
+ * timer into the active state.\r
+ *\r
+ * @param pcTimerName A text name that is assigned to the timer.  This is done\r
+ * purely to assist debugging.  The kernel itself only ever references a timer\r
+ * by its handle, and never by its name.\r
+ *\r
+ * @param xTimerPeriodInTicks The timer period.  The time is defined in tick\r
+ * periods so the constant portTICK_PERIOD_MS can be used to convert a time that\r
+ * has been specified in milliseconds.  For example, if the timer must expire\r
+ * after 100 ticks, then xTimerPeriodInTicks should be set to 100.\r
+ * Alternatively, if the timer must expire after 500ms, then xPeriod can be set\r
+ * to ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than or\r
+ * equal to 1000.\r
+ *\r
+ * @param uxAutoReload If uxAutoReload is set to pdTRUE then the timer will\r
+ * expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter.\r
+ * If uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and\r
+ * enter the dormant state after it expires.\r
+ *\r
+ * @param pvTimerID An identifier that is assigned to the timer being created.\r
+ * Typically this would be used in the timer callback function to identify which\r
+ * timer expired when the same callback function is assigned to more than one\r
+ * timer.\r
+ *\r
+ * @param pxCallbackFunction The function to call when the timer expires.\r
+ * Callback functions must have the prototype defined by TimerCallbackFunction_t,\r
+ * which is "void vCallbackFunction( TimerHandle_t xTimer );".\r
+ *\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 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
+ *\r
+ * // The buffer used to hold the software timer's data structure.\r
+ * static StaticTimer_t xTimerBuffer;\r
+ *\r
+ * // A variable that will be incremented by the software timer's callback\r
+ * // function.\r
+ * UBaseType_t uxVariableToIncrement = 0;\r
+ *\r
+ * // A software timer callback function that increments a variable passed to\r
+ * // it when the software timer was created.  After the 5th increment the\r
+ * // callback function stops the software timer.\r
+ * static void prvTimerCallback( TimerHandle_t xExpiredTimer )\r
+ * {\r
+ * UBaseType_t *puxVariableToIncrement;\r
+ * BaseType_t xReturned;\r
+ *\r
+ *     // Obtain the address of the variable to increment from the timer ID.\r
+ *     puxVariableToIncrement = ( UBaseType_t * ) pvTimerGetTimerID( xExpiredTimer );\r
+ *\r
+ *     // Increment the variable to show the timer callback has executed.\r
+ *     ( *puxVariableToIncrement )++;\r
+ *\r
+ *     // If this callback has executed the required number of times, stop the\r
+ *     // timer.\r
+ *     if( *puxVariableToIncrement == 5 )\r
+ *     {\r
+ *         // This is called from a timer callback so must not block.\r
+ *         xTimerStop( xExpiredTimer, staticDONT_BLOCK );\r
+ *     }\r
+ * }\r
+ *\r
+ *\r
+ * void main( void )\r
+ * {\r
+ *     // Create the software time.  xTimerCreateStatic() has an extra parameter\r
+ *     // than the normal xTimerCreate() API function.  The parameter is a pointer\r
+ *     // to the StaticTimer_t structure that will hold the software timer\r
+ *     // structure.  If the parameter is passed as NULL then the structure will be\r
+ *     // allocated dynamically, just as if xTimerCreate() had been called.\r
+ *     xTimer = xTimerCreateStatic( "T1",             // Text name for the task.  Helps debugging only.  Not used by FreeRTOS.\r
+ *                                  xTimerPeriod,     // The period of the timer in ticks.\r
+ *                                  pdTRUE,           // This is an auto-reload timer.\r
+ *                                  ( void * ) &uxVariableToIncrement,    // A variable incremented by the software timer's callback function\r
+ *                                  prvTimerCallback, // The function to execute when the timer expires.\r
+ *                                  &xTimerBuffer );  // The buffer that will hold the software timer structure.\r
+ *\r
+ *     // The scheduler has not started yet so a block time is not used.\r
+ *     xReturned = xTimerStart( xTimer, 0 );\r
+ *\r
+ *     // ...\r
+ *     // Create tasks here.\r
+ *     // ...\r
+ *\r
+ *     // Starting the scheduler will start the timers running as they have already\r
+ *     // been set into the active state.\r
+ *     vTaskStartScheduler();\r
+ *\r
+ *     // Should not reach here.\r
+ *     for( ;; );\r
+ * }\r
+ * @endverbatim\r
+ */\r
+#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
+       TimerHandle_t xTimerCreateStatic(       const char * const pcTimerName,                 /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                                               const TickType_t xTimerPeriodInTicks,\r
+                                                                               const UBaseType_t uxAutoReload,\r
+                                                                               void * const pvTimerID,\r
+                                                                               TimerCallbackFunction_t pxCallbackFunction,\r
+                                                                               StaticTimer_t *pxTimerBuffer ) PRIVILEGED_FUNCTION;\r
+#endif /* configSUPPORT_STATIC_ALLOCATION */\r
 \r
 /**\r
  * void *pvTimerGetTimerID( TimerHandle_t xTimer );\r
@@ -260,11 +368,11 @@ TimerHandle_t xTimerCreate( const char * const pcTimerName, const TickType_t xTi
  * Returns the ID assigned to the timer.\r
  *\r
  * IDs are assigned to timers using the pvTimerID parameter of the call to\r
- * xTimerCreated() that was used to create the timer.\r
+ * xTimerCreated() that was used to create the timer, and by calling the\r
+ * vTimerSetTimerID() API function.\r
  *\r
  * If the same callback function is assigned to multiple timers then the timer\r
- * ID can be used within the callback function to identify which timer actually\r
- * expired.\r
+ * ID can be used as time specific (timer local) storage.\r
  *\r
  * @param xTimer The timer being queried.\r
  *\r
@@ -274,7 +382,28 @@ TimerHandle_t xTimerCreate( const char * const pcTimerName, const TickType_t xTi
  *\r
  * See the xTimerCreate() API function example usage scenario.\r
  */\r
-void *pvTimerGetTimerID( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;\r
+void *pvTimerGetTimerID( const TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;\r
+\r
+/**\r
+ * void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID );\r
+ *\r
+ * Sets the ID assigned to the timer.\r
+ *\r
+ * IDs are assigned to timers using the pvTimerID parameter of the call to\r
+ * xTimerCreated() that was used to create the timer.\r
+ *\r
+ * If the same callback function is assigned to multiple timers then the timer\r
+ * ID can be used as time specific (timer local) storage.\r
+ *\r
+ * @param xTimer The timer being updated.\r
+ *\r
+ * @param pvNewID The ID to assign to the timer.\r
+ *\r
+ * Example usage:\r
+ *\r
+ * See the xTimerCreate() API function example usage scenario.\r
+ */\r
+void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer );\r
@@ -316,13 +445,10 @@ BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
 /**\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
-TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );\r
+TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * BaseType_t xTimerStart( TimerHandle_t xTimer, TickType_t xTicksToWait );\r
@@ -651,7 +777,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
  *\r
  *     // Starting the scheduler will start the timer running as it has already\r
  *     // been set into the active state.\r
- *     xTaskStartScheduler();\r
+ *     vTaskStartScheduler();\r
  *\r
  *     // Should not reach here.\r
  *     for( ;; );\r
@@ -662,7 +788,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
 \r
 /**\r
  * BaseType_t xTimerStartFromISR(      TimerHandle_t xTimer,\r
- *                                                                             BaseType_t *pxHigherPriorityTaskWoken );\r
+ *                                                                     BaseType_t *pxHigherPriorityTaskWoken );\r
  *\r
  * A version of xTimerStart() that can be called from an interrupt service\r
  * routine.\r
@@ -748,7 +874,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
 \r
 /**\r
  * BaseType_t xTimerStopFromISR(       TimerHandle_t xTimer,\r
- *                                                                             BaseType_t *pxHigherPriorityTaskWoken );\r
+ *                                                                     BaseType_t *pxHigherPriorityTaskWoken );\r
  *\r
  * A version of xTimerStop() that can be called from an interrupt service\r
  * routine.\r
@@ -811,8 +937,8 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
 \r
 /**\r
  * BaseType_t xTimerChangePeriodFromISR( TimerHandle_t xTimer,\r
- *                                                                                     TickType_t xNewPeriod,\r
- *                                                                                     BaseType_t *pxHigherPriorityTaskWoken );\r
+ *                                                                              TickType_t xNewPeriod,\r
+ *                                                                              BaseType_t *pxHigherPriorityTaskWoken );\r
  *\r
  * A version of xTimerChangePeriod() that can be called from an interrupt\r
  * service routine.\r
@@ -880,11 +1006,11 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
  * }\r
  * @endverbatim\r
  */\r
-#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), ( pxHigherPriorityTaskWoken ), 0U )\r
+#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD_FROM_ISR, ( xNewPeriod ), ( pxHigherPriorityTaskWoken ), 0U )\r
 \r
 /**\r
  * BaseType_t xTimerResetFromISR(      TimerHandle_t xTimer,\r
- *                                                                             BaseType_t *pxHigherPriorityTaskWoken );\r
+ *                                                                     BaseType_t *pxHigherPriorityTaskWoken );\r
  *\r
  * A version of xTimerReset() that can be called from an interrupt service\r
  * routine.\r
@@ -1057,7 +1183,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
  *     }\r
  * @endverbatim\r
  */\r
-BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken );\r
+BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;\r
 \r
  /**\r
   * BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,\r
@@ -1091,7 +1217,44 @@ BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void
   * timer daemon task, otherwise pdFALSE is returned.\r
   *\r
   */\r
-BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait );\r
+BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
+\r
+/**\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
+ * @param xTimer The handle of the timer being queried.\r
+ *\r
+ * @return The name assigned to the timer specified by the xTimer parameter.\r
+ */\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
@@ -1100,6 +1263,11 @@ BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvPar
 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
 \r
+#if( configUSE_TRACE_FACILITY == 1 )\r
+       void vTimerSetTimerNumber( TimerHandle_t xTimer, UBaseType_t uxTimerNumber ) PRIVILEGED_FUNCTION;\r
+       UBaseType_t uxTimerGetTimerNumber( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;\r
+#endif\r
+\r
 #ifdef __cplusplus\r
 }\r
 #endif\r