]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/timers.h
Make the pcObjectGetName() API function naming consistent - so rename pcTaskGetTaskNa...
[freertos] / FreeRTOS / Source / include / timers.h
index b8bd73e593b6e4d821501392d602114e88af9aaa..1e029dbf60cf0aba5928cce3f78c8b864e51a0e7 100644 (file)
@@ -1,75 +1,70 @@
 /*\r
 /*\r
-    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
-\r
-    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
-    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
-     *    Complete, revised, and edited pdf reference manuals are also       *\r
-     *    available.                                                         *\r
-     *                                                                       *\r
-     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
-     *    ensuring you get running as quickly as possible and with an        *\r
-     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
-     *    the FreeRTOS project to continue with its mission of providing     *\r
-     *    professional grade, cross platform, de facto standard solutions    *\r
-     *    for microcontrollers - completely free of charge!                  *\r
-     *                                                                       *\r
-     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
-     *                                                                       *\r
-     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
-     *                                                                       *\r
-    ***************************************************************************\r
+    FreeRTOS V9.0.0rc1 - Copyright (C) 2016 Real Time Engineers Ltd.\r
+    All rights reserved\r
 \r
 \r
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\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
 \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
+    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
 \r
 \r
-    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
-    distribute a combined work that includes FreeRTOS without being obliged to\r
-    provide the source code for proprietary components outside of the FreeRTOS\r
-    kernel.\r
+    ***************************************************************************\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
+    ***************************************************************************\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
 \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.  See the GNU General Public License for more\r
-    details. You should have received a copy of the GNU General Public License\r
-    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
-    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
-    writing to Real Time Engineers Ltd., contact details for whom are available\r
-    on the FreeRTOS WEB site.\r
-\r
-    1 tab == 4 spaces!\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
+    link: http://www.freertos.org/a00114.html\r
 \r
     ***************************************************************************\r
      *                                                                       *\r
 \r
     ***************************************************************************\r
      *                                                                       *\r
-     *    Having a problem?  Start by reading the FAQ "My application does   *\r
-     *    not run, what could be wrong?"                                     *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that is more than just the market leader, it     *\r
+     *    is the industry's de facto standard.                               *\r
      *                                                                       *\r
      *                                                                       *\r
-     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *    Help yourself get started quickly while simultaneously helping     *\r
+     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
+     *    tutorial book, reference manual, or both:                          *\r
+     *    http://www.FreeRTOS.org/Documentation                              *\r
      *                                                                       *\r
     ***************************************************************************\r
 \r
      *                                                                       *\r
     ***************************************************************************\r
 \r
+    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
+    the FAQ page "My application does not run, what could be wrong?".  Have you\r
+    defined configASSERT()?\r
+\r
+    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
+    embedded software for free we request you assist our global community by\r
+    participating in the support forum.\r
 \r
 \r
-    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
-    license and Real Time Engineers Ltd. contact details.\r
+    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
+    be as productive as possible as early as possible.  Now you can receive\r
+    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
+    Ltd, and the world's leading authority on the world's leading RTOS.\r
 \r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
 \r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
-    fully thread aware and reentrant UDP/IP stack.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
-    Integrity Systems, who sell the code with commercial support, \r
-    indemnification and middleware, under the OpenRTOS brand.\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
+    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.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
+    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
+    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and commercial 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
     mission critical applications that require provable dependability.\r
+\r
+    1 tab == 4 spaces!\r
 */\r
 \r
 \r
 */\r
 \r
 \r
        #error "include FreeRTOS.h must appear in source files before include timers.h"\r
 #endif\r
 \r
        #error "include FreeRTOS.h must appear in source files before include timers.h"\r
 #endif\r
 \r
-#include "portable.h"\r
-#include "list.h"\r
+/*lint -e537 This headers are only multiply included if the application code\r
+happens to also be including task.h. */\r
 #include "task.h"\r
 #include "task.h"\r
+/*lint +e537 */\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
 #endif\r
 \r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
 #endif\r
 \r
-/* IDs for commands that can be sent/received on the timer queue.  These are to\r
-be used solely through the macros that make up the public software timer API,\r
-as defined below. */\r
-#define tmrCOMMAND_START                                       0\r
-#define tmrCOMMAND_STOP                                                1\r
-#define tmrCOMMAND_CHANGE_PERIOD                       2\r
-#define tmrCOMMAND_DELETE                                      3\r
-\r
 /*-----------------------------------------------------------\r
  * MACROS AND DEFINITIONS\r
  *----------------------------------------------------------*/\r
 \r
 /*-----------------------------------------------------------\r
  * MACROS AND DEFINITIONS\r
  *----------------------------------------------------------*/\r
 \r
- /**\r
+/* IDs for commands that can be sent/received on the timer queue.  These are to\r
+be used solely through the macros that make up the public software timer API,\r
+as defined below.  The commands that are sent from interrupts must use the\r
+highest numbers as tmrFIRST_FROM_ISR_COMMAND is used to determine if the task\r
+or interrupt version of the queue send function should be used. */\r
+#define tmrCOMMAND_EXECUTE_CALLBACK_FROM_ISR   ( ( BaseType_t ) -2 )\r
+#define tmrCOMMAND_EXECUTE_CALLBACK                            ( ( BaseType_t ) -1 )\r
+#define tmrCOMMAND_START_DONT_TRACE                            ( ( BaseType_t ) 0 )\r
+#define tmrCOMMAND_START                                           ( ( BaseType_t ) 1 )\r
+#define tmrCOMMAND_RESET                                               ( ( BaseType_t ) 2 )\r
+#define tmrCOMMAND_STOP                                                        ( ( BaseType_t ) 3 )\r
+#define tmrCOMMAND_CHANGE_PERIOD                               ( ( BaseType_t ) 4 )\r
+#define tmrCOMMAND_DELETE                                              ( ( BaseType_t ) 5 )\r
+\r
+#define tmrFIRST_FROM_ISR_COMMAND                              ( ( BaseType_t ) 6 )\r
+#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
  * Type by which software timers are referenced.  For example, a call to\r
  * Type by which software timers are referenced.  For example, a call to\r
- * xTimerCreate() returns an xTimerHandle variable that can then be used to\r
+ * xTimerCreate() returns an TimerHandle_t variable that can then be used to\r
  * reference the subject timer in calls to other software timer API functions\r
  * (for example, xTimerStart(), xTimerReset(), etc.).\r
  */\r
  * reference the subject timer in calls to other software timer API functions\r
  * (for example, xTimerStart(), xTimerReset(), etc.).\r
  */\r
-typedef void * xTimerHandle;\r
+typedef void * TimerHandle_t;\r
+\r
+/*\r
+ * Defines the prototype to which timer callback functions must conform.\r
+ */\r
+typedef void (*TimerCallbackFunction_t)( TimerHandle_t xTimer );\r
 \r
 \r
-/* Define the prototype to which timer callback functions must conform. */\r
-typedef void (*tmrTIMER_CALLBACK)( xTimerHandle xTimer );\r
+/*\r
+ * Defines the prototype to which functions used with the\r
+ * xTimerPendFunctionCallFromISR() function must conform.\r
+ */\r
+typedef void (*PendedFunction_t)( void *, uint32_t );\r
 \r
 /**\r
 \r
 /**\r
- * xTimerHandle xTimerCreate(  const signed char *pcTimerName,\r
- *                                                             portTickType xTimerPeriodInTicks,\r
- *                                                             unsigned portBASE_TYPE uxAutoReload,\r
+ * TimerHandle_t xTimerCreate(         const char * const pcTimerName,\r
+ *                                                             TickType_t xTimerPeriodInTicks,\r
+ *                                                             UBaseType_t uxAutoReload,\r
  *                                                             void * pvTimerID,\r
  *                                                             void * pvTimerID,\r
- *                                                             tmrTIMER_CALLBACK pxCallbackFunction );\r
+ *                                                             TimerCallbackFunction_t pxCallbackFunction );\r
+ *\r
+ * Creates a new software timer instance, and returns a handle by which the\r
+ * created software timer can be referenced.\r
  *\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
+ * 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
  *\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 timer into the\r
- * active state.\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
  *\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 by\r
- * its handle, and never by its name.\r
+ * purely to assist debugging.  The kernel itself only ever references a timer\r
+ * by its handle, and never by its name.\r
  *\r
  *\r
- * @param xTimerPeriodInTicks The timer period.  The time is defined in tick periods so\r
- * the constant portTICK_RATE_MS can be used to convert a time that has been\r
- * specified in milliseconds.  For example, if the timer must expire after 100\r
- * ticks, then xTimerPeriodInTicks should be set to 100.  Alternatively, if the timer\r
- * must expire after 500ms, then xPeriod can be set to ( 500 / portTICK_RATE_MS )\r
- * provided configTICK_RATE_HZ is less than or equal to 1000.\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
  *\r
  * @param uxAutoReload If uxAutoReload is set to pdTRUE then the timer will\r
- * expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter.  If\r
- * uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and\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
  * enter the dormant state after it expires.\r
  *\r
  * @param pvTimerID An identifier that is assigned to the timer being created.\r
@@ -149,38 +175,38 @@ typedef void (*tmrTIMER_CALLBACK)( xTimerHandle xTimer );
  * timer.\r
  *\r
  * @param pxCallbackFunction The function to call when the timer expires.\r
  * timer.\r
  *\r
  * @param pxCallbackFunction The function to call when the timer expires.\r
- * Callback functions must have the prototype defined by tmrTIMER_CALLBACK,\r
- * which is    "void vCallbackFunction( xTimerHandle xTimer );".\r
+ * Callback functions must have the prototype defined by TimerCallbackFunction_t,\r
+ * which is    "void vCallbackFunction( TimerHandle_t xTimer );".\r
  *\r
  *\r
- * @return If the timer is successfully create then a handle to the newly\r
+ * @return If the timer is successfully created then a handle to the newly\r
  * created timer is returned.  If the timer cannot be created (because either\r
  * there is insufficient FreeRTOS heap remaining to allocate the timer\r
  * created timer is returned.  If the timer cannot be created (because either\r
  * there is insufficient FreeRTOS heap remaining to allocate the timer\r
- * structures, or the timer period was set to 0) then 0 is returned.\r
+ * structures, or the timer period was set to 0) then NULL is returned.\r
  *\r
  * Example usage:\r
  *\r
  * Example usage:\r
- *\r
+ * @verbatim\r
  * #define NUM_TIMERS 5\r
  *\r
  * // An array to hold handles to the created timers.\r
  * #define NUM_TIMERS 5\r
  *\r
  * // An array to hold handles to the created timers.\r
- * xTimerHandle xTimers[ NUM_TIMERS ];\r
+ * TimerHandle_t xTimers[ NUM_TIMERS ];\r
  *\r
  * // An array to hold a count of the number of times each timer expires.\r
  *\r
  * // An array to hold a count of the number of times each timer expires.\r
- * long lExpireCounters[ NUM_TIMERS ] = { 0 };\r
+ * int32_t lExpireCounters[ NUM_TIMERS ] = { 0 };\r
  *\r
  * // Define a callback function that will be used by multiple timer instances.\r
  * // The callback function does nothing but count the number of times the\r
  * // associated timer expires, and stop the timer once the timer has expired\r
  * // 10 times.\r
  *\r
  * // Define a callback function that will be used by multiple timer instances.\r
  * // The callback function does nothing but count the number of times the\r
  * // associated timer expires, and stop the timer once the timer has expired\r
  * // 10 times.\r
- * void vTimerCallback( xTimerHandle pxTimer )\r
+ * void vTimerCallback( TimerHandle_t pxTimer )\r
  * {\r
  * {\r
- * long lArrayIndex;\r
- * const long xMaxExpiryCountBeforeStopping = 10;\r
+ * int32_t lArrayIndex;\r
+ * const int32_t xMaxExpiryCountBeforeStopping = 10;\r
  *\r
  *        // Optionally do something if the pxTimer parameter is NULL.\r
  *        configASSERT( pxTimer );\r
  *\r
  *        // Optionally do something if the pxTimer parameter is NULL.\r
  *        configASSERT( pxTimer );\r
- *     \r
+ *\r
  *     // Which timer expired?\r
  *     // Which timer expired?\r
- *     lArrayIndex = ( long ) pvTimerGetTimerID( pxTimer );\r
+ *     lArrayIndex = ( int32_t ) pvTimerGetTimerID( pxTimer );\r
  *\r
  *     // Increment the number of times that pxTimer has expired.\r
  *     lExpireCounters[ lArrayIndex ] += 1;\r
  *\r
  *     // Increment the number of times that pxTimer has expired.\r
  *     lExpireCounters[ lArrayIndex ] += 1;\r
@@ -196,18 +222,18 @@ typedef void (*tmrTIMER_CALLBACK)( xTimerHandle xTimer );
  *\r
  * void main( void )\r
  * {\r
  *\r
  * void main( void )\r
  * {\r
- * long x;\r
+ * int32_t x;\r
  *\r
  *     // Create then start some timers.  Starting the timers before the scheduler\r
  *     // has been started means the timers will start running immediately that\r
  *     // the scheduler starts.\r
  *     for( x = 0; x < NUM_TIMERS; x++ )\r
  *     {\r
  *\r
  *     // Create then start some timers.  Starting the timers before the scheduler\r
  *     // has been started means the timers will start running immediately that\r
  *     // the scheduler starts.\r
  *     for( x = 0; x < NUM_TIMERS; x++ )\r
  *     {\r
- *         xTimers[ x ] = xTimerCreate(     "Timer",         // Just a text name, not used by the kernel.\r
- *                                         ( 100 * x ),     // The timer period in ticks.\r
- *                                         pdTRUE,         // The timers will auto-reload themselves when they expire.\r
- *                                         ( void * ) x,     // Assign each timer a unique id equal to its array index.\r
- *                                         vTimerCallback     // Each timer calls the same callback when it expires.\r
+ *         xTimers[ x ] = xTimerCreate(    "Timer",       // Just a text name, not used by the kernel.\r
+ *                                         ( 100 * x ),   // The timer period in ticks.\r
+ *                                         pdTRUE,        // The timers will auto-reload themselves when they expire.\r
+ *                                         ( void * ) x,  // Assign each timer a unique id equal to its array index.\r
+ *                                         vTimerCallback // Each timer calls the same callback when it expires.\r
  *                                     );\r
  *\r
  *         if( xTimers[ x ] == NULL )\r
  *                                     );\r
  *\r
  *         if( xTimers[ x ] == NULL )\r
@@ -237,20 +263,149 @@ typedef void (*tmrTIMER_CALLBACK)( xTimerHandle xTimer );
  *     // Should not reach here.\r
  *     for( ;; );\r
  * }\r
  *     // Should not reach here.\r
  *     for( ;; );\r
  * }\r
+ * @endverbatim\r
  */\r
  */\r
-xTimerHandle xTimerCreate( const signed char * const pcTimerName, portTickType xTimerPeriodInTicks, unsigned portBASE_TYPE uxAutoReload, void * pvTimerID, tmrTIMER_CALLBACK pxCallbackFunction ) PRIVILEGED_FUNCTION;\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
 \r
 /**\r
- * void *pvTimerGetTimerID( xTimerHandle xTimer );\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
+ *     xTaskStartScheduler();\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, 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
+ * void *pvTimerGetTimerID( TimerHandle_t xTimer );\r
  *\r
  * Returns the ID assigned to the timer.\r
  *\r
  * IDs are assigned to timers using the pvTimerID parameter of the call to\r
  *\r
  * 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
  *\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
  *\r
  * @param xTimer The timer being queried.\r
  *\r
@@ -260,16 +415,37 @@ xTimerHandle xTimerCreate( const signed char * const pcTimerName, portTickType x
  *\r
  * See the xTimerCreate() API function example usage scenario.\r
  */\r
  *\r
  * See the xTimerCreate() API function example usage scenario.\r
  */\r
-void *pvTimerGetTimerID( xTimerHandle 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
 \r
 /**\r
- * portBASE_TYPE xTimerIsTimerActive( xTimerHandle xTimer );\r
+ * BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer );\r
  *\r
  * Queries a timer to see if it is active or dormant.\r
  *\r
  * A timer will be dormant if:\r
  *     1) It has been created but not started, or\r
  *\r
  * Queries a timer to see if it is active or dormant.\r
  *\r
  * A timer will be dormant if:\r
  *     1) It has been created but not started, or\r
- *     2) It is an expired on-shot timer that has not been restarted.\r
+ *     2) It is an expired one-shot timer that has not been restarted.\r
  *\r
  * Timers are created in the dormant state.  The xTimerStart(), xTimerReset(),\r
  * xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and\r
  *\r
  * Timers are created in the dormant state.  The xTimerStart(), xTimerReset(),\r
  * xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and\r
@@ -282,9 +458,9 @@ void *pvTimerGetTimerID( xTimerHandle xTimer ) PRIVILEGED_FUNCTION;
  * pdFALSE will be returned if the timer is active.\r
  *\r
  * Example usage:\r
  * pdFALSE will be returned if the timer is active.\r
  *\r
  * Example usage:\r
- *\r
+ * @verbatim\r
  * // This function assumes xTimer has already been created.\r
  * // This function assumes xTimer has already been created.\r
- * void vAFunction( xTimerHandle xTimer )\r
+ * void vAFunction( TimerHandle_t xTimer )\r
  * {\r
  *     if( xTimerIsTimerActive( xTimer ) != pdFALSE ) // or more simply and equivalently "if( xTimerIsTimerActive( xTimer ) )"\r
  *     {\r
  * {\r
  *     if( xTimerIsTimerActive( xTimer ) != pdFALSE ) // or more simply and equivalently "if( xTimerIsTimerActive( xTimer ) )"\r
  *     {\r
@@ -295,24 +471,27 @@ void *pvTimerGetTimerID( xTimerHandle xTimer ) PRIVILEGED_FUNCTION;
  *         // xTimer is not active, do something else.\r
  *     }\r
  * }\r
  *         // xTimer is not active, do something else.\r
  *     }\r
  * }\r
+ * @endverbatim\r
  */\r
  */\r
-portBASE_TYPE xTimerIsTimerActive( xTimerHandle xTimer ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
 \r
 /**\r
- * xTimerGetTimerDaemonTaskHandle() is only available if \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
  * 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
-xTaskHandle xTimerGetTimerDaemonTaskHandle( void );\r
+TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
 \r
 /**\r
- * portBASE_TYPE xTimerStart( xTimerHandle xTimer, portTickType xBlockTime );\r
+ * BaseType_t xTimerStart( TimerHandle_t xTimer, TickType_t xTicksToWait );\r
  *\r
  * Timer functionality is provided by a timer service/daemon task.  Many of the\r
  * public FreeRTOS timer API functions send commands to the timer service task\r
  *\r
  * Timer functionality is provided by a timer service/daemon task.  Many of the\r
  * public FreeRTOS timer API functions send commands to the timer service task\r
- * though a queue called the timer command queue.  The timer command queue is\r
+ * through a queue called the timer command queue.  The timer command queue is\r
  * private to the kernel itself and is not directly accessible to application\r
  * code.  The length of the timer command queue is set by the\r
  * configTIMER_QUEUE_LENGTH configuration constant.\r
  * private to the kernel itself and is not directly accessible to application\r
  * code.  The length of the timer command queue is set by the\r
  * configTIMER_QUEUE_LENGTH configuration constant.\r
@@ -337,14 +516,14 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *\r
  * @param xTimer The handle of the timer being started/restarted.\r
  *\r
  *\r
  * @param xTimer The handle of the timer being started/restarted.\r
  *\r
- * @param xBlockTime Specifies the time, in ticks, that the calling task should\r
+ * @param xTicksToWait Specifies the time, in ticks, that the calling task should\r
  * be held in the Blocked state to wait for the start command to be successfully\r
  * sent to the timer command queue, should the queue already be full when\r
  * be held in the Blocked state to wait for the start command to be successfully\r
  * sent to the timer command queue, should the queue already be full when\r
- * xTimerStart() was called.  xBlockTime is ignored if xTimerStart() is called\r
+ * xTimerStart() was called.  xTicksToWait is ignored if xTimerStart() is called\r
  * before the scheduler is started.\r
  *\r
  * @return pdFAIL will be returned if the start command could not be sent to\r
  * before the scheduler is started.\r
  *\r
  * @return pdFAIL will be returned if the start command could not be sent to\r
- * the timer command queue even after xBlockTime ticks had passed.  pdPASS will\r
+ * the timer command queue even after xTicksToWait ticks had passed.  pdPASS will\r
  * be returned if the command was successfully sent to the timer command queue.\r
  * When the command is actually processed will depend on the priority of the\r
  * timer service/daemon task relative to other tasks in the system, although the\r
  * be returned if the command was successfully sent to the timer command queue.\r
  * When the command is actually processed will depend on the priority of the\r
  * timer service/daemon task relative to other tasks in the system, although the\r
@@ -357,14 +536,14 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * See the xTimerCreate() API function example usage scenario.\r
  *\r
  */\r
  * See the xTimerCreate() API function example usage scenario.\r
  *\r
  */\r
-#define xTimerStart( xTimer, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xBlockTime ) )\r
+#define xTimerStart( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) )\r
 \r
 /**\r
 \r
 /**\r
- * portBASE_TYPE xTimerStop( xTimerHandle xTimer, portTickType xBlockTime );\r
+ * BaseType_t xTimerStop( TimerHandle_t xTimer, TickType_t xTicksToWait );\r
  *\r
  * Timer functionality is provided by a timer service/daemon task.  Many of the\r
  * public FreeRTOS timer API functions send commands to the timer service task\r
  *\r
  * Timer functionality is provided by a timer service/daemon task.  Many of the\r
  * public FreeRTOS timer API functions send commands to the timer service task\r
- * though a queue called the timer command queue.  The timer command queue is\r
+ * through a queue called the timer command queue.  The timer command queue is\r
  * private to the kernel itself and is not directly accessible to application\r
  * code.  The length of the timer command queue is set by the\r
  * configTIMER_QUEUE_LENGTH configuration constant.\r
  * private to the kernel itself and is not directly accessible to application\r
  * code.  The length of the timer command queue is set by the\r
  * configTIMER_QUEUE_LENGTH configuration constant.\r
@@ -380,14 +559,14 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *\r
  * @param xTimer The handle of the timer being stopped.\r
  *\r
  *\r
  * @param xTimer The handle of the timer being stopped.\r
  *\r
- * @param xBlockTime Specifies the time, in ticks, that the calling task should\r
+ * @param xTicksToWait Specifies the time, in ticks, that the calling task should\r
  * be held in the Blocked state to wait for the stop command to be successfully\r
  * sent to the timer command queue, should the queue already be full when\r
  * be held in the Blocked state to wait for the stop command to be successfully\r
  * sent to the timer command queue, should the queue already be full when\r
- * xTimerStop() was called.  xBlockTime is ignored if xTimerStop() is called\r
+ * xTimerStop() was called.  xTicksToWait is ignored if xTimerStop() is called\r
  * before the scheduler is started.\r
  *\r
  * @return pdFAIL will be returned if the stop command could not be sent to\r
  * before the scheduler is started.\r
  *\r
  * @return pdFAIL will be returned if the stop command could not be sent to\r
- * the timer command queue even after xBlockTime ticks had passed.  pdPASS will\r
+ * the timer command queue even after xTicksToWait ticks had passed.  pdPASS will\r
  * be returned if the command was successfully sent to the timer command queue.\r
  * When the command is actually processed will depend on the priority of the\r
  * timer service/daemon task relative to other tasks in the system.  The timer\r
  * be returned if the command was successfully sent to the timer command queue.\r
  * When the command is actually processed will depend on the priority of the\r
  * timer service/daemon task relative to other tasks in the system.  The timer\r
@@ -399,16 +578,16 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * See the xTimerCreate() API function example usage scenario.\r
  *\r
  */\r
  * See the xTimerCreate() API function example usage scenario.\r
  *\r
  */\r
-#define xTimerStop( xTimer, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0U, NULL, ( xBlockTime ) )\r
+#define xTimerStop( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0U, NULL, ( xTicksToWait ) )\r
 \r
 /**\r
 \r
 /**\r
- * portBASE_TYPE xTimerChangePeriod(   xTimerHandle xTimer,\r
- *                                                                             portTickType xNewPeriod,\r
- *                                                                             portTickType xBlockTime );\r
+ * BaseType_t xTimerChangePeriod(      TimerHandle_t xTimer,\r
+ *                                                                             TickType_t xNewPeriod,\r
+ *                                                                             TickType_t xTicksToWait );\r
  *\r
  * Timer functionality is provided by a timer service/daemon task.  Many of the\r
  * public FreeRTOS timer API functions send commands to the timer service task\r
  *\r
  * Timer functionality is provided by a timer service/daemon task.  Many of the\r
  * public FreeRTOS timer API functions send commands to the timer service task\r
- * though a queue called the timer command queue.  The timer command queue is\r
+ * through a queue called the timer command queue.  The timer command queue is\r
  * private to the kernel itself and is not directly accessible to application\r
  * code.  The length of the timer command queue is set by the\r
  * configTIMER_QUEUE_LENGTH configuration constant.\r
  * private to the kernel itself and is not directly accessible to application\r
  * code.  The length of the timer command queue is set by the\r
  * configTIMER_QUEUE_LENGTH configuration constant.\r
@@ -425,21 +604,21 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * @param xTimer The handle of the timer that is having its period changed.\r
  *\r
  * @param xNewPeriod The new period for xTimer. Timer periods are specified in\r
  * @param xTimer The handle of the timer that is having its period changed.\r
  *\r
  * @param xNewPeriod The new period for xTimer. Timer periods are specified in\r
- * tick periods, so the constant portTICK_RATE_MS can be used to convert a time\r
+ * tick periods, so the constant portTICK_PERIOD_MS can be used to convert a time\r
  * that has been specified in milliseconds.  For example, if the timer must\r
  * expire after 100 ticks, then xNewPeriod should be set to 100.  Alternatively,\r
  * if the timer must expire after 500ms, then xNewPeriod can be set to\r
  * that has been specified in milliseconds.  For example, if the timer must\r
  * expire after 100 ticks, then xNewPeriod should be set to 100.  Alternatively,\r
  * if the timer must expire after 500ms, then xNewPeriod can be set to\r
- * ( 500 / portTICK_RATE_MS ) provided configTICK_RATE_HZ is less than\r
+ * ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than\r
  * or equal to 1000.\r
  *\r
  * or equal to 1000.\r
  *\r
- * @param xBlockTime Specifies the time, in ticks, that the calling task should\r
+ * @param xTicksToWait Specifies the time, in ticks, that the calling task should\r
  * be held in the Blocked state to wait for the change period command to be\r
  * successfully sent to the timer command queue, should the queue already be\r
  * be held in the Blocked state to wait for the change period command to be\r
  * successfully sent to the timer command queue, should the queue already be\r
- * full when xTimerChangePeriod() was called.  xBlockTime is ignored if\r
+ * full when xTimerChangePeriod() was called.  xTicksToWait is ignored if\r
  * xTimerChangePeriod() is called before the scheduler is started.\r
  *\r
  * @return pdFAIL will be returned if the change period command could not be\r
  * xTimerChangePeriod() is called before the scheduler is started.\r
  *\r
  * @return pdFAIL will be returned if the change period command could not be\r
- * sent to the timer command queue even after xBlockTime ticks had passed.\r
+ * sent to the timer command queue even after xTicksToWait ticks had passed.\r
  * pdPASS will be returned if the command was successfully sent to the timer\r
  * command queue.  When the command is actually processed will depend on the\r
  * priority of the timer service/daemon task relative to other tasks in the\r
  * pdPASS will be returned if the command was successfully sent to the timer\r
  * command queue.  When the command is actually processed will depend on the\r
  * priority of the timer service/daemon task relative to other tasks in the\r
@@ -447,13 +626,13 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * configTIMER_TASK_PRIORITY configuration constant.\r
  *\r
  * Example usage:\r
  * configTIMER_TASK_PRIORITY configuration constant.\r
  *\r
  * Example usage:\r
- *\r
+ * @verbatim\r
  * // This function assumes xTimer has already been created.  If the timer\r
  * // referenced by xTimer is already active when it is called, then the timer\r
  * // is deleted.  If the timer referenced by xTimer is not active when it is\r
  * // called, then the period of the timer is set to 500ms and the timer is\r
  * // started.\r
  * // This function assumes xTimer has already been created.  If the timer\r
  * // referenced by xTimer is already active when it is called, then the timer\r
  * // is deleted.  If the timer referenced by xTimer is not active when it is\r
  * // called, then the period of the timer is set to 500ms and the timer is\r
  * // started.\r
- * void vAFunction( xTimerHandle xTimer )\r
+ * void vAFunction( TimerHandle_t xTimer )\r
  * {\r
  *     if( xTimerIsTimerActive( xTimer ) != pdFALSE ) // or more simply and equivalently "if( xTimerIsTimerActive( xTimer ) )"\r
  *     {\r
  * {\r
  *     if( xTimerIsTimerActive( xTimer ) != pdFALSE ) // or more simply and equivalently "if( xTimerIsTimerActive( xTimer ) )"\r
  *     {\r
@@ -466,7 +645,7 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *         // cause the timer to start.  Block for a maximum of 100 ticks if the\r
  *         // change period command cannot immediately be sent to the timer\r
  *         // command queue.\r
  *         // cause the timer to start.  Block for a maximum of 100 ticks if the\r
  *         // change period command cannot immediately be sent to the timer\r
  *         // command queue.\r
- *         if( xTimerChangePeriod( xTimer, 500 / portTICK_RATE_MS, 100 ) == pdPASS )\r
+ *         if( xTimerChangePeriod( xTimer, 500 / portTICK_PERIOD_MS, 100 ) == pdPASS )\r
  *         {\r
  *             // The command was successfully sent.\r
  *         }\r
  *         {\r
  *             // The command was successfully sent.\r
  *         }\r
@@ -477,15 +656,16 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *         }\r
  *     }\r
  * }\r
  *         }\r
  *     }\r
  * }\r
+ * @endverbatim\r
  */\r
  */\r
- #define xTimerChangePeriod( xTimer, xNewPeriod, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), NULL, ( xBlockTime ) )\r
+ #define xTimerChangePeriod( xTimer, xNewPeriod, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), NULL, ( xTicksToWait ) )\r
 \r
 /**\r
 \r
 /**\r
- * portBASE_TYPE xTimerDelete( xTimerHandle xTimer, portTickType xBlockTime );\r
+ * BaseType_t xTimerDelete( TimerHandle_t xTimer, TickType_t xTicksToWait );\r
  *\r
  * Timer functionality is provided by a timer service/daemon task.  Many of the\r
  * public FreeRTOS timer API functions send commands to the timer service task\r
  *\r
  * Timer functionality is provided by a timer service/daemon task.  Many of the\r
  * public FreeRTOS timer API functions send commands to the timer service task\r
- * though a queue called the timer command queue.  The timer command queue is\r
+ * through a queue called the timer command queue.  The timer command queue is\r
  * private to the kernel itself and is not directly accessible to application\r
  * code.  The length of the timer command queue is set by the\r
  * configTIMER_QUEUE_LENGTH configuration constant.\r
  * private to the kernel itself and is not directly accessible to application\r
  * code.  The length of the timer command queue is set by the\r
  * configTIMER_QUEUE_LENGTH configuration constant.\r
@@ -498,14 +678,14 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *\r
  * @param xTimer The handle of the timer being deleted.\r
  *\r
  *\r
  * @param xTimer The handle of the timer being deleted.\r
  *\r
- * @param xBlockTime Specifies the time, in ticks, that the calling task should\r
+ * @param xTicksToWait Specifies the time, in ticks, that the calling task should\r
  * be held in the Blocked state to wait for the delete command to be\r
  * successfully sent to the timer command queue, should the queue already be\r
  * be held in the Blocked state to wait for the delete command to be\r
  * successfully sent to the timer command queue, should the queue already be\r
- * full when xTimerDelete() was called.  xBlockTime is ignored if xTimerDelete()\r
+ * full when xTimerDelete() was called.  xTicksToWait is ignored if xTimerDelete()\r
  * is called before the scheduler is started.\r
  *\r
  * @return pdFAIL will be returned if the delete command could not be sent to\r
  * is called before the scheduler is started.\r
  *\r
  * @return pdFAIL will be returned if the delete command could not be sent to\r
- * the timer command queue even after xBlockTime ticks had passed.  pdPASS will\r
+ * the timer command queue even after xTicksToWait ticks had passed.  pdPASS will\r
  * be returned if the command was successfully sent to the timer command queue.\r
  * When the command is actually processed will depend on the priority of the\r
  * timer service/daemon task relative to other tasks in the system.  The timer\r
  * be returned if the command was successfully sent to the timer command queue.\r
  * When the command is actually processed will depend on the priority of the\r
  * timer service/daemon task relative to other tasks in the system.  The timer\r
@@ -516,14 +696,14 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *\r
  * See the xTimerChangePeriod() API function example usage scenario.\r
  */\r
  *\r
  * See the xTimerChangePeriod() API function example usage scenario.\r
  */\r
-#define xTimerDelete( xTimer, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_DELETE, 0U, NULL, ( xBlockTime ) )\r
+#define xTimerDelete( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_DELETE, 0U, NULL, ( xTicksToWait ) )\r
 \r
 /**\r
 \r
 /**\r
- * portBASE_TYPE xTimerReset( xTimerHandle xTimer, portTickType xBlockTime );\r
+ * BaseType_t xTimerReset( TimerHandle_t xTimer, TickType_t xTicksToWait );\r
  *\r
  * Timer functionality is provided by a timer service/daemon task.  Many of the\r
  * public FreeRTOS timer API functions send commands to the timer service task\r
  *\r
  * Timer functionality is provided by a timer service/daemon task.  Many of the\r
  * public FreeRTOS timer API functions send commands to the timer service task\r
- * though a queue called the timer command queue.  The timer command queue is\r
+ * through a queue called the timer command queue.  The timer command queue is\r
  * private to the kernel itself and is not directly accessible to application\r
  * code.  The length of the timer command queue is set by the\r
  * configTIMER_QUEUE_LENGTH configuration constant.\r
  * private to the kernel itself and is not directly accessible to application\r
  * code.  The length of the timer command queue is set by the\r
  * configTIMER_QUEUE_LENGTH configuration constant.\r
@@ -550,14 +730,14 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *\r
  * @param xTimer The handle of the timer being reset/started/restarted.\r
  *\r
  *\r
  * @param xTimer The handle of the timer being reset/started/restarted.\r
  *\r
- * @param xBlockTime Specifies the time, in ticks, that the calling task should\r
+ * @param xTicksToWait Specifies the time, in ticks, that the calling task should\r
  * be held in the Blocked state to wait for the reset command to be successfully\r
  * sent to the timer command queue, should the queue already be full when\r
  * be held in the Blocked state to wait for the reset command to be successfully\r
  * sent to the timer command queue, should the queue already be full when\r
- * xTimerReset() was called.  xBlockTime is ignored if xTimerReset() is called\r
+ * xTimerReset() was called.  xTicksToWait is ignored if xTimerReset() is called\r
  * before the scheduler is started.\r
  *\r
  * @return pdFAIL will be returned if the reset command could not be sent to\r
  * before the scheduler is started.\r
  *\r
  * @return pdFAIL will be returned if the reset command could not be sent to\r
- * the timer command queue even after xBlockTime ticks had passed.  pdPASS will\r
+ * the timer command queue even after xTicksToWait ticks had passed.  pdPASS will\r
  * be returned if the command was successfully sent to the timer command queue.\r
  * When the command is actually processed will depend on the priority of the\r
  * timer service/daemon task relative to other tasks in the system, although the\r
  * be returned if the command was successfully sent to the timer command queue.\r
  * When the command is actually processed will depend on the priority of the\r
  * timer service/daemon task relative to other tasks in the system, although the\r
@@ -566,16 +746,16 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * configuration constant.\r
  *\r
  * Example usage:\r
  * configuration constant.\r
  *\r
  * Example usage:\r
- *\r
+ * @verbatim\r
  * // When a key is pressed, an LCD back-light is switched on.  If 5 seconds pass\r
  * // without a key being pressed, then the LCD back-light is switched off.  In\r
  * // this case, the timer is a one-shot timer.\r
  *\r
  * // When a key is pressed, an LCD back-light is switched on.  If 5 seconds pass\r
  * // without a key being pressed, then the LCD back-light is switched off.  In\r
  * // this case, the timer is a one-shot timer.\r
  *\r
- * xTimerHandle xBacklightTimer = NULL;\r
+ * TimerHandle_t xBacklightTimer = NULL;\r
  *\r
  * // The callback function assigned to the one-shot timer.  In this case the\r
  * // parameter is not used.\r
  *\r
  * // The callback function assigned to the one-shot timer.  In this case the\r
  * // parameter is not used.\r
- * void vBacklightTimerCallback( xTimerHandle pxTimer )\r
+ * void vBacklightTimerCallback( TimerHandle_t pxTimer )\r
  * {\r
  *     // The timer expired, therefore 5 seconds must have passed since a key\r
  *     // was pressed.  Switch off the LCD back-light.\r
  * {\r
  *     // The timer expired, therefore 5 seconds must have passed since a key\r
  *     // was pressed.  Switch off the LCD back-light.\r
@@ -601,12 +781,12 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *\r
  * void main( void )\r
  * {\r
  *\r
  * void main( void )\r
  * {\r
- * long x;\r
+ * int32_t x;\r
  *\r
  *     // Create then start the one-shot timer that is responsible for turning\r
  *     // the back-light off if no keys are pressed within a 5 second period.\r
  *     xBacklightTimer = xTimerCreate( "BacklightTimer",           // Just a text name, not used by the kernel.\r
  *\r
  *     // Create then start the one-shot timer that is responsible for turning\r
  *     // the back-light off if no keys are pressed within a 5 second period.\r
  *     xBacklightTimer = xTimerCreate( "BacklightTimer",           // Just a text name, not used by the kernel.\r
- *                                     ( 5000 / portTICK_RATE_MS), // The timer period in ticks.\r
+ *                                     ( 5000 / portTICK_PERIOD_MS), // The timer period in ticks.\r
  *                                     pdFALSE,                    // The timer is a one-shot timer.\r
  *                                     0,                          // The id is not used by the callback so can take any value.\r
  *                                     vBacklightTimerCallback     // The callback function that switches the LCD back-light off.\r
  *                                     pdFALSE,                    // The timer is a one-shot timer.\r
  *                                     0,                          // The id is not used by the callback so can take any value.\r
  *                                     vBacklightTimerCallback     // The callback function that switches the LCD back-light off.\r
@@ -638,12 +818,13 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *     // Should not reach here.\r
  *     for( ;; );\r
  * }\r
  *     // Should not reach here.\r
  *     for( ;; );\r
  * }\r
+ * @endverbatim\r
  */\r
  */\r
-#define xTimerReset( xTimer, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xBlockTime ) )\r
+#define xTimerReset( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) )\r
 \r
 /**\r
 \r
 /**\r
- * portBASE_TYPE xTimerStartFromISR(   xTimerHandle xTimer,\r
- *                                                                             portBASE_TYPE *pxHigherPriorityTaskWoken );\r
+ * BaseType_t xTimerStartFromISR(      TimerHandle_t xTimer,\r
+ *                                                                     BaseType_t *pxHigherPriorityTaskWoken );\r
  *\r
  * A version of xTimerStart() that can be called from an interrupt service\r
  * routine.\r
  *\r
  * A version of xTimerStart() that can be called from an interrupt service\r
  * routine.\r
@@ -667,11 +848,12 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * successfully sent to the timer command queue.  When the command is actually\r
  * processed will depend on the priority of the timer service/daemon task\r
  * relative to other tasks in the system, although the timers expiry time is\r
  * successfully sent to the timer command queue.  When the command is actually\r
  * processed will depend on the priority of the timer service/daemon task\r
  * relative to other tasks in the system, although the timers expiry time is\r
- * relative to when xTimerStartFromISR() is actually called.  The timer service/daemon\r
- * task priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
+ * relative to when xTimerStartFromISR() is actually called.  The timer\r
+ * service/daemon task priority is set by the configTIMER_TASK_PRIORITY\r
+ * configuration constant.\r
  *\r
  * Example usage:\r
  *\r
  * Example usage:\r
- *\r
+ * @verbatim\r
  * // This scenario assumes xBacklightTimer has already been created.  When a\r
  * // key is pressed, an LCD back-light is switched on.  If 5 seconds pass\r
  * // without a key being pressed, then the LCD back-light is switched off.  In\r
  * // This scenario assumes xBacklightTimer has already been created.  When a\r
  * // key is pressed, an LCD back-light is switched on.  If 5 seconds pass\r
  * // without a key being pressed, then the LCD back-light is switched off.  In\r
@@ -681,7 +863,7 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *\r
  * // The callback function assigned to the one-shot timer.  In this case the\r
  * // parameter is not used.\r
  *\r
  * // The callback function assigned to the one-shot timer.  In this case the\r
  * // parameter is not used.\r
- * void vBacklightTimerCallback( xTimerHandle pxTimer )\r
+ * void vBacklightTimerCallback( TimerHandle_t pxTimer )\r
  * {\r
  *     // The timer expired, therefore 5 seconds must have passed since a key\r
  *     // was pressed.  Switch off the LCD back-light.\r
  * {\r
  *     // The timer expired, therefore 5 seconds must have passed since a key\r
  *     // was pressed.  Switch off the LCD back-light.\r
@@ -691,7 +873,7 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * // The key press interrupt service routine.\r
  * void vKeyPressEventInterruptHandler( void )\r
  * {\r
  * // The key press interrupt service routine.\r
  * void vKeyPressEventInterruptHandler( void )\r
  * {\r
- * portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE;\r
  *\r
  *     // Ensure the LCD back-light is on, then restart the timer that is\r
  *     // responsible for turning the back-light off after 5 seconds of\r
  *\r
  *     // Ensure the LCD back-light is on, then restart the timer that is\r
  *     // responsible for turning the back-light off after 5 seconds of\r
@@ -719,15 +901,16 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *     if( xHigherPriorityTaskWoken != pdFALSE )\r
  *     {\r
  *         // Call the interrupt safe yield function here (actual function\r
  *     if( xHigherPriorityTaskWoken != pdFALSE )\r
  *     {\r
  *         // Call the interrupt safe yield function here (actual function\r
- *         // depends on the FreeRTOS port being used.\r
+ *         // depends on the FreeRTOS port being used).\r
  *     }\r
  * }\r
  *     }\r
  * }\r
+ * @endverbatim\r
  */\r
  */\r
-#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )\r
+#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )\r
 \r
 /**\r
 \r
 /**\r
- * portBASE_TYPE xTimerStopFromISR(    xTimerHandle xTimer,\r
- *                                                                             portBASE_TYPE *pxHigherPriorityTaskWoken );\r
+ * BaseType_t xTimerStopFromISR(       TimerHandle_t xTimer,\r
+ *                                                                     BaseType_t *pxHigherPriorityTaskWoken );\r
  *\r
  * A version of xTimerStop() that can be called from an interrupt service\r
  * routine.\r
  *\r
  * A version of xTimerStop() that can be called from an interrupt service\r
  * routine.\r
@@ -754,14 +937,14 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
  *\r
  * Example usage:\r
  * priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
  *\r
  * Example usage:\r
- *\r
+ * @verbatim\r
  * // This scenario assumes xTimer has already been created and started.  When\r
  * // an interrupt occurs, the timer should be simply stopped.\r
  *\r
  * // The interrupt service routine that stops the timer.\r
  * void vAnExampleInterruptServiceRoutine( void )\r
  * {\r
  * // This scenario assumes xTimer has already been created and started.  When\r
  * // an interrupt occurs, the timer should be simply stopped.\r
  *\r
  * // The interrupt service routine that stops the timer.\r
  * void vAnExampleInterruptServiceRoutine( void )\r
  * {\r
- * portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE;\r
  *\r
  *     // The interrupt has occurred - simply stop the timer.\r
  *     // xHigherPriorityTaskWoken was set to pdFALSE where it was defined\r
  *\r
  *     // The interrupt has occurred - simply stop the timer.\r
  *     // xHigherPriorityTaskWoken was set to pdFALSE where it was defined\r
@@ -781,16 +964,17 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *     if( xHigherPriorityTaskWoken != pdFALSE )\r
  *     {\r
  *         // Call the interrupt safe yield function here (actual function\r
  *     if( xHigherPriorityTaskWoken != pdFALSE )\r
  *     {\r
  *         // Call the interrupt safe yield function here (actual function\r
- *         // depends on the FreeRTOS port being used.\r
+ *         // depends on the FreeRTOS port being used).\r
  *     }\r
  * }\r
  *     }\r
  * }\r
+ * @endverbatim\r
  */\r
  */\r
-#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0, ( pxHigherPriorityTaskWoken ), 0U )\r
+#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP_FROM_ISR, 0, ( pxHigherPriorityTaskWoken ), 0U )\r
 \r
 /**\r
 \r
 /**\r
- * portBASE_TYPE xTimerChangePeriodFromISR( xTimerHandle xTimer,\r
- *                                                                                     portTickType xNewPeriod,\r
- *                                                                                     portBASE_TYPE *pxHigherPriorityTaskWoken );\r
+ * BaseType_t xTimerChangePeriodFromISR( TimerHandle_t xTimer,\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
  *\r
  * A version of xTimerChangePeriod() that can be called from an interrupt\r
  * service routine.\r
@@ -798,11 +982,11 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * @param xTimer The handle of the timer that is having its period changed.\r
  *\r
  * @param xNewPeriod The new period for xTimer. Timer periods are specified in\r
  * @param xTimer The handle of the timer that is having its period changed.\r
  *\r
  * @param xNewPeriod The new period for xTimer. Timer periods are specified in\r
- * tick periods, so the constant portTICK_RATE_MS can be used to convert a time\r
+ * tick periods, so the constant portTICK_PERIOD_MS can be used to convert a time\r
  * that has been specified in milliseconds.  For example, if the timer must\r
  * expire after 100 ticks, then xNewPeriod should be set to 100.  Alternatively,\r
  * if the timer must expire after 500ms, then xNewPeriod can be set to\r
  * that has been specified in milliseconds.  For example, if the timer must\r
  * expire after 100 ticks, then xNewPeriod should be set to 100.  Alternatively,\r
  * if the timer must expire after 500ms, then xNewPeriod can be set to\r
- * ( 500 / portTICK_RATE_MS ) provided configTICK_RATE_HZ is less than\r
+ * ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than\r
  * or equal to 1000.\r
  *\r
  * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most\r
  * or equal to 1000.\r
  *\r
  * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most\r
@@ -826,14 +1010,14 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
  *\r
  * Example usage:\r
  * priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
  *\r
  * Example usage:\r
- *\r
+ * @verbatim\r
  * // This scenario assumes xTimer has already been created and started.  When\r
  * // an interrupt occurs, the period of xTimer should be changed to 500ms.\r
  *\r
  * // The interrupt service routine that changes the period of xTimer.\r
  * void vAnExampleInterruptServiceRoutine( void )\r
  * {\r
  * // This scenario assumes xTimer has already been created and started.  When\r
  * // an interrupt occurs, the period of xTimer should be changed to 500ms.\r
  *\r
  * // The interrupt service routine that changes the period of xTimer.\r
  * void vAnExampleInterruptServiceRoutine( void )\r
  * {\r
- * portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE;\r
  *\r
  *     // The interrupt has occurred - change the period of xTimer to 500ms.\r
  *     // xHigherPriorityTaskWoken was set to pdFALSE where it was defined\r
  *\r
  *     // The interrupt has occurred - change the period of xTimer to 500ms.\r
  *     // xHigherPriorityTaskWoken was set to pdFALSE where it was defined\r
@@ -853,15 +1037,16 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *     if( xHigherPriorityTaskWoken != pdFALSE )\r
  *     {\r
  *         // Call the interrupt safe yield function here (actual function\r
  *     if( xHigherPriorityTaskWoken != pdFALSE )\r
  *     {\r
  *         // Call the interrupt safe yield function here (actual function\r
- *         // depends on the FreeRTOS port being used.\r
+ *         // depends on the FreeRTOS port being used).\r
  *     }\r
  * }\r
  *     }\r
  * }\r
+ * @endverbatim\r
  */\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
 \r
 /**\r
- * portBASE_TYPE xTimerResetFromISR(   xTimerHandle xTimer,\r
- *                                                                             portBASE_TYPE *pxHigherPriorityTaskWoken );\r
+ * BaseType_t xTimerResetFromISR(      TimerHandle_t xTimer,\r
+ *                                                                     BaseType_t *pxHigherPriorityTaskWoken );\r
  *\r
  * A version of xTimerReset() that can be called from an interrupt service\r
  * routine.\r
  *\r
  * A version of xTimerReset() that can be called from an interrupt service\r
  * routine.\r
@@ -890,7 +1075,7 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * task priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
  *\r
  * Example usage:\r
  * task priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
  *\r
  * Example usage:\r
- *\r
+ * @verbatim\r
  * // This scenario assumes xBacklightTimer has already been created.  When a\r
  * // key is pressed, an LCD back-light is switched on.  If 5 seconds pass\r
  * // without a key being pressed, then the LCD back-light is switched off.  In\r
  * // This scenario assumes xBacklightTimer has already been created.  When a\r
  * // key is pressed, an LCD back-light is switched on.  If 5 seconds pass\r
  * // without a key being pressed, then the LCD back-light is switched off.  In\r
@@ -900,7 +1085,7 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *\r
  * // The callback function assigned to the one-shot timer.  In this case the\r
  * // parameter is not used.\r
  *\r
  * // The callback function assigned to the one-shot timer.  In this case the\r
  * // parameter is not used.\r
- * void vBacklightTimerCallback( xTimerHandle pxTimer )\r
+ * void vBacklightTimerCallback( TimerHandle_t pxTimer )\r
  * {\r
  *     // The timer expired, therefore 5 seconds must have passed since a key\r
  *     // was pressed.  Switch off the LCD back-light.\r
  * {\r
  *     // The timer expired, therefore 5 seconds must have passed since a key\r
  *     // was pressed.  Switch off the LCD back-light.\r
@@ -910,7 +1095,7 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  * // The key press interrupt service routine.\r
  * void vKeyPressEventInterruptHandler( void )\r
  * {\r
  * // The key press interrupt service routine.\r
  * void vKeyPressEventInterruptHandler( void )\r
  * {\r
- * portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE;\r
  *\r
  *     // Ensure the LCD back-light is on, then reset the timer that is\r
  *     // responsible for turning the back-light off after 5 seconds of\r
  *\r
  *     // Ensure the LCD back-light is on, then reset the timer that is\r
  *     // responsible for turning the back-light off after 5 seconds of\r
@@ -938,18 +1123,181 @@ xTaskHandle xTimerGetTimerDaemonTaskHandle( void );
  *     if( xHigherPriorityTaskWoken != pdFALSE )\r
  *     {\r
  *         // Call the interrupt safe yield function here (actual function\r
  *     if( xHigherPriorityTaskWoken != pdFALSE )\r
  *     {\r
  *         // Call the interrupt safe yield function here (actual function\r
- *         // depends on the FreeRTOS port being used.\r
+ *         // depends on the FreeRTOS port being used).\r
  *     }\r
  * }\r
  *     }\r
  * }\r
+ * @endverbatim\r
+ */\r
+#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )\r
+\r
+\r
+/**\r
+ * BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,\r
+ *                                          void *pvParameter1,\r
+ *                                          uint32_t ulParameter2,\r
+ *                                          BaseType_t *pxHigherPriorityTaskWoken );\r
+ *\r
+ *\r
+ * Used from application interrupt service routines to defer the execution of a\r
+ * function to the RTOS daemon task (the timer service task, hence this function\r
+ * is implemented in timers.c and is prefixed with 'Timer').\r
+ *\r
+ * Ideally an interrupt service routine (ISR) is kept as short as possible, but\r
+ * sometimes an ISR either has a lot of processing to do, or needs to perform\r
+ * processing that is not deterministic.  In these cases\r
+ * xTimerPendFunctionCallFromISR() can be used to defer processing of a function\r
+ * to the RTOS daemon task.\r
+ *\r
+ * A mechanism is provided that allows the interrupt to return directly to the\r
+ * task that will subsequently execute the pended callback function.  This\r
+ * allows the callback function to execute contiguously in time with the\r
+ * interrupt - just as if the callback had executed in the interrupt itself.\r
+ *\r
+ * @param xFunctionToPend The function to execute from the timer service/\r
+ * daemon task.  The function must conform to the PendedFunction_t\r
+ * prototype.\r
+ *\r
+ * @param pvParameter1 The value of the callback function's first parameter.\r
+ * The parameter has a void * type to allow it to be used to pass any type.\r
+ * For example, unsigned longs can be cast to a void *, or the void * can be\r
+ * used to point to a structure.\r
+ *\r
+ * @param ulParameter2 The value of the callback function's second parameter.\r
+ *\r
+ * @param pxHigherPriorityTaskWoken As mentioned above, calling this function\r
+ * will result in a message being sent to the timer daemon task.  If the\r
+ * priority of the timer daemon task (which is set using\r
+ * configTIMER_TASK_PRIORITY in FreeRTOSConfig.h) is higher than the priority of\r
+ * the currently running task (the task the interrupt interrupted) then\r
+ * *pxHigherPriorityTaskWoken will be set to pdTRUE within\r
+ * xTimerPendFunctionCallFromISR(), indicating that a context switch should be\r
+ * requested before the interrupt exits.  For that reason\r
+ * *pxHigherPriorityTaskWoken must be initialised to pdFALSE.  See the\r
+ * example code below.\r
+ *\r
+ * @return pdPASS is returned if the message was successfully sent to the\r
+ * timer daemon task, otherwise pdFALSE is returned.\r
+ *\r
+ * Example usage:\r
+ * @verbatim\r
+ *\r
+ *     // The callback function that will execute in the context of the daemon task.\r
+ *  // Note callback functions must all use this same prototype.\r
+ *  void vProcessInterface( void *pvParameter1, uint32_t ulParameter2 )\r
+ *     {\r
+ *             BaseType_t xInterfaceToService;\r
+ *\r
+ *             // The interface that requires servicing is passed in the second\r
+ *      // parameter.  The first parameter is not used in this case.\r
+ *             xInterfaceToService = ( BaseType_t ) ulParameter2;\r
+ *\r
+ *             // ...Perform the processing here...\r
+ *     }\r
+ *\r
+ *     // An ISR that receives data packets from multiple interfaces\r
+ *  void vAnISR( void )\r
+ *     {\r
+ *             BaseType_t xInterfaceToService, xHigherPriorityTaskWoken;\r
+ *\r
+ *             // Query the hardware to determine which interface needs processing.\r
+ *             xInterfaceToService = prvCheckInterfaces();\r
+ *\r
+ *      // The actual processing is to be deferred to a task.  Request the\r
+ *      // vProcessInterface() callback function is executed, passing in the\r
+ *             // number of the interface that needs processing.  The interface to\r
+ *             // service is passed in the second parameter.  The first parameter is\r
+ *             // not used in this case.\r
+ *             xHigherPriorityTaskWoken = pdFALSE;\r
+ *             xTimerPendFunctionCallFromISR( vProcessInterface, NULL, ( uint32_t ) xInterfaceToService, &xHigherPriorityTaskWoken );\r
+ *\r
+ *             // If xHigherPriorityTaskWoken is now set to pdTRUE then a context\r
+ *             // switch should be requested.  The macro used is port specific and will\r
+ *             // be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - refer to\r
+ *             // the documentation page for the port being used.\r
+ *             portYIELD_FROM_ISR( xHigherPriorityTaskWoken );\r
+ *\r
+ *     }\r
+ * @endverbatim\r
  */\r
  */\r
-#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )\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
+  *                                    void *pvParameter1,\r
+  *                                    uint32_t ulParameter2,\r
+  *                                    TickType_t xTicksToWait );\r
+  *\r
+  *\r
+  * Used to defer the execution of a function to the RTOS daemon task (the timer\r
+  * service task, hence this function is implemented in timers.c and is prefixed\r
+  * with 'Timer').\r
+  *\r
+  * @param xFunctionToPend The function to execute from the timer service/\r
+  * daemon task.  The function must conform to the PendedFunction_t\r
+  * prototype.\r
+  *\r
+  * @param pvParameter1 The value of the callback function's first parameter.\r
+  * The parameter has a void * type to allow it to be used to pass any type.\r
+  * For example, unsigned longs can be cast to a void *, or the void * can be\r
+  * used to point to a structure.\r
+  *\r
+  * @param ulParameter2 The value of the callback function's second parameter.\r
+  *\r
+  * @param xTicksToWait Calling this function will result in a message being\r
+  * sent to the timer daemon task on a queue.  xTicksToWait is the amount of\r
+  * time the calling task should remain in the Blocked state (so not using any\r
+  * processing time) for space to become available on the timer queue if the\r
+  * queue is found to be full.\r
+  *\r
+  * @return pdPASS is returned if the message was successfully sent to the\r
+  * timer daemon task, otherwise pdFALSE is returned.\r
+  *\r
+  */\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
  * for use by the kernel only.\r
  */\r
 \r
 /*\r
  * Functions beyond this part are not part of the public API and are intended\r
  * for use by the kernel only.\r
  */\r
-portBASE_TYPE xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;\r
-portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portTickType xBlockTime ) PRIVILEGED_FUNCTION;\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
 \r
 #ifdef __cplusplus\r
 }\r
 \r
 #ifdef __cplusplus\r
 }\r