]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/event_groups.h
Update version numbers in preparation for new release.
[freertos] / FreeRTOS / Source / include / event_groups.h
index 3ca5ac3f5fb464a2076adb31750857b23686904f..106ed603c03be16021ffd8839e8fe55a38b8fedb 100644 (file)
@@ -1,60 +1,64 @@
 /*\r
-    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    FreeRTOS V8.2.2 - Copyright (C) 2015 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
+    >>!   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
-    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available on 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
+     *    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
-     *    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
-    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
-    license and Real Time Engineers Ltd. contact details.\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
+    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
     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
+    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
@@ -82,7 +86,7 @@ extern "C" {
  * the status of various CAN bus related events in which bit 0 might mean "A CAN\r
  * message has been received and is ready for processing", bit 1 might mean "The\r
  * application has queued a message that is ready for sending onto the CAN\r
- * network", and bit 2 might mean "it is time to send a SYNC message onto the\r
+ * network", and bit 2 might mean "It is time to send a SYNC message onto the\r
  * CAN network" etc.  A task can then test the bit values to see which events\r
  * are active, and optionally enter the Blocked state to wait for a specified\r
  * bit or a group of specified bits to be active.  To continue the CAN bus\r
@@ -109,18 +113,28 @@ extern "C" {
  * event_groups.h\r
  *\r
  * Type by which event groups are referenced.  For example, a call to\r
- * xEventGroupCreate() returns an xEventGroupHandle variable that can then\r
+ * xEventGroupCreate() returns an EventGroupHandle_t variable that can then\r
  * be used as a parameter to other event group functions.\r
  *\r
- * \defgroup xEventGroupHandle xEventGroupHandle\r
+ * \defgroup EventGroupHandle_t EventGroupHandle_t\r
  * \ingroup EventGroup\r
  */\r
-typedef void * xEventGroupHandle;\r
+typedef void * EventGroupHandle_t;\r
+\r
+/* \r
+ * The type that holds event bits always matches TickType_t - therefore the\r
+ * number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,\r
+ * 32 bits if set to 0. \r
+ *\r
+ * \defgroup EventBits_t EventBits_t\r
+ * \ingroup EventGroup\r
+ */\r
+typedef TickType_t EventBits_t;\r
 \r
 /**\r
  * event_groups.h\r
  *<pre>\r
xEventGroupHandle xEventGroupCreate( void );\r
EventGroupHandle_t xEventGroupCreate( void );\r
  </pre>\r
  *\r
  * Create a new event group.  This function cannot be called from an interrupt.\r
@@ -130,7 +144,7 @@ typedef void * xEventGroupHandle;
  * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h.  If\r
  * configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit\r
  * 0 to bit 7).  If configUSE_16_BIT_TICKS is set to 0 then each event group has\r
- * 24 usable bits (bit 0 to bit 23).  The xEventBitsType type is used to store\r
+ * 24 usable bits (bit 0 to bit 23).  The EventBits_t type is used to store\r
  * event bits within an event group.\r
  *\r
  * @return If the event group was created then a handle to the event group is\r
@@ -140,7 +154,7 @@ typedef void * xEventGroupHandle;
  * Example usage:\r
    <pre>\r
        // Declare a variable to hold the created event group.\r
-       xEventGroupHandle xCreatedEventGroup;\r
+       EventGroupHandle_t xCreatedEventGroup;\r
 \r
        // Attempt to create the event group.\r
        xCreatedEventGroup = xEventGroupCreate();\r
@@ -159,16 +173,16 @@ typedef void * xEventGroupHandle;
  * \defgroup xEventGroupCreate xEventGroupCreate\r
  * \ingroup EventGroup\r
  */\r
-xEventGroupHandle xEventGroupCreate( void ) PRIVILEGED_FUNCTION;\r
+EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * event_groups.h\r
  *<pre>\r
-       xEventBitsType xEventGroupWaitBits( xEventGroupHandle xEventGroup,\r
-                                                                               xEventBitsType uxBitsToWaitFor,\r
-                                                                               portBASE_TYPE xClearOnExit,\r
-                                                                               portBASE_TYPE xWaitForAllBits,\r
-                                                                               portTickType xTicksToWait );\r
+       EventBits_t xEventGroupWaitBits(        EventGroupHandle_t xEventGroup,\r
+                                                                               const EventBits_t uxBitsToWaitFor,\r
+                                                                               const BaseType_t xClearOnExit,\r
+                                                                               const BaseType_t xWaitForAllBits,\r
+                                                                               const TickType_t xTicksToWait );\r
  </pre>\r
  *\r
  * [Potentially] block to wait for one or more bits to be set within a\r
@@ -187,15 +201,17 @@ xEventGroupHandle xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
  *\r
  * @param xClearOnExit If xClearOnExit is set to pdTRUE then any bits within\r
  * uxBitsToWaitFor that are set within the event group will be cleared before\r
- * xEventGroupWaitBits() returns.  If xClearOnExit is set to pdFALSE then the\r
- * bits set in the event group are not altered when the call to\r
+ * xEventGroupWaitBits() returns if the wait condition was met (if the function\r
+ * returns for a reason other than a timeout).  If xClearOnExit is set to\r
+ * pdFALSE then the bits set in the event group are not altered when the call to\r
  * xEventGroupWaitBits() returns.\r
  *\r
  * @param xWaitForAllBits If xWaitForAllBits is set to pdTRUE then\r
  * xEventGroupWaitBits() will return when either all the bits in uxBitsToWaitFor\r
  * are set or the specified block time expires.  If xWaitForAllBits is set to\r
  * pdFALSE then xEventGroupWaitBits() will return when any one of the bits set\r
- * in uxBitsToWaitFor is set or the specified block time expires.\r
+ * in uxBitsToWaitFor is set or the specified block time expires.  The block\r
+ * time is specified by the xTicksToWait parameter.\r
  *\r
  * @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait\r
  * for one/all (depending on the xWaitForAllBits value) of the bits specified by\r
@@ -207,17 +223,18 @@ xEventGroupHandle xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
  * expired then not all the bits being waited for will be set.  If\r
  * xEventGroupWaitBits() returned because the bits it was waiting for were set\r
  * then the returned value is the event group value before any bits were\r
- * automatically cleared because the xClearOnExit parameter was set to pdTRUE.\r
+ * automatically cleared in the case that xClearOnExit parameter was set to\r
+ * pdTRUE.\r
  *\r
  * Example usage:\r
    <pre>\r
    #define BIT_0       ( 1 << 0 )\r
    #define BIT_4       ( 1 << 4 )\r
 \r
-   void aFunction( xEventGroupHandle xEventGroup )\r
+   void aFunction( EventGroupHandle_t xEventGroup )\r
    {\r
-   xEventBitsType uxBits;\r
-   const portTickType xTicksToWait = 100 / portTICK_RATE_MS;\r
+   EventBits_t uxBits;\r
+   const TickType_t xTicksToWait = 100 / portTICK_PERIOD_MS;\r
 \r
                // Wait a maximum of 100ms for either bit 0 or bit 4 to be set within\r
                // the event group.  Clear the bits before exiting.\r
@@ -250,12 +267,12 @@ xEventGroupHandle xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
  * \defgroup xEventGroupWaitBits xEventGroupWaitBits\r
  * \ingroup EventGroup\r
  */\r
-xEventBitsType xEventGroupWaitBits( xEventGroupHandle xEventGroup, xEventBitsType uxBitsToWaitFor, portBASE_TYPE xClearOnExit, portBASE_TYPE xWaitForAllBits, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
+EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * event_groups.h\r
  *<pre>\r
-       xEventBitsType xEventGroupClearBits( xEventGroupHandle xEventGroup, xEventBitsType uxBitsToClear );\r
+       EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear );\r
  </pre>\r
  *\r
  * Clear bits within an event group.  This function cannot be called from an\r
@@ -274,9 +291,9 @@ xEventBitsType xEventGroupWaitBits( xEventGroupHandle xEventGroup, xEventBitsTyp
    #define BIT_0       ( 1 << 0 )\r
    #define BIT_4       ( 1 << 4 )\r
 \r
-   void aFunction( xEventGroupHandle xEventGroup )\r
+   void aFunction( EventGroupHandle_t xEventGroup )\r
    {\r
-   xEventBitsType uxBits;\r
+   EventBits_t uxBits;\r
 \r
                // Clear bit 0 and bit 4 in xEventGroup.\r
                uxBits = xEventGroupClearBits(\r
@@ -285,9 +302,8 @@ xEventBitsType xEventGroupWaitBits( xEventGroupHandle xEventGroup, xEventBitsTyp
 \r
                if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) )\r
                {\r
-                       // Both bit 0 and bit 4 were set before the call to\r
-                       // xEventGroupClearBits() was called.  Both will now be clear (not\r
-                       // set).\r
+                       // Both bit 0 and bit 4 were set before xEventGroupClearBits() was\r
+                       // called.  Both will now be clear (not set).\r
                }\r
                else if( ( uxBits & BIT_0 ) != 0 )\r
                {\r
@@ -308,12 +324,71 @@ xEventBitsType xEventGroupWaitBits( xEventGroupHandle xEventGroup, xEventBitsTyp
  * \defgroup xEventGroupClearBits xEventGroupClearBits\r
  * \ingroup EventGroup\r
  */\r
-xEventBitsType xEventGroupClearBits( xEventGroupHandle xEventGroup, xEventBitsType uxBitsToClear ) PRIVILEGED_FUNCTION;\r
+EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * event_groups.h\r
  *<pre>\r
-       xEventBitsType xEventGroupSetBits( xEventGroupHandle xEventGroup, xEventBitsType uxBitsToSet );\r
+       BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );\r
+ </pre>\r
+ *\r
+ * A version of xEventGroupClearBits() that can be called from an interrupt.\r
+ *\r
+ * Setting bits in an event group is not a deterministic operation because there\r
+ * are an unknown number of tasks that may be waiting for the bit or bits being\r
+ * set.  FreeRTOS does not allow nondeterministic operations to be performed\r
+ * while interrupts are disabled, so protects event groups that are accessed\r
+ * from tasks by suspending the scheduler rather than disabling interrupts.  As\r
+ * a result event groups cannot be accessed directly from an interrupt service\r
+ * routine.  Therefore xEventGroupClearBitsFromISR() sends a message to the \r
+ * timer task to have the clear operation performed in the context of the timer \r
+ * task.\r
+ *\r
+ * @param xEventGroup The event group in which the bits are to be cleared.\r
+ *\r
+ * @param uxBitsToClear A bitwise value that indicates the bit or bits to clear.\r
+ * For example, to clear bit 3 only, set uxBitsToClear to 0x08.  To clear bit 3\r
+ * and bit 0 set uxBitsToClear to 0x09.\r
+ *\r
+ * @return If the request to execute the function was posted successfully then \r
+ * pdPASS is returned, otherwise pdFALSE is returned.  pdFALSE will be returned \r
+ * if the timer service queue was full.\r
+ *\r
+ * Example usage:\r
+   <pre>\r
+   #define BIT_0       ( 1 << 0 )\r
+   #define BIT_4       ( 1 << 4 )\r
+\r
+   // An event group which it is assumed has already been created by a call to\r
+   // xEventGroupCreate().\r
+   EventGroupHandle_t xEventGroup;\r
+\r
+   void anInterruptHandler( void )\r
+   {\r
+               // Clear bit 0 and bit 4 in xEventGroup.\r
+               xResult = xEventGroupClearBitsFromISR(\r
+                                                       xEventGroup,     // The event group being updated.\r
+                                                       BIT_0 | BIT_4 ); // The bits being set.\r
+\r
+               if( xResult == pdPASS )\r
+               {\r
+                       // The message was posted successfully.\r
+               }\r
+  }\r
+   </pre>\r
+ * \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR\r
+ * \ingroup EventGroup\r
+ */\r
+#if( configUSE_TRACE_FACILITY == 1 )\r
+       BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION;\r
+#else\r
+       #define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL )\r
+#endif\r
+\r
+/**\r
+ * event_groups.h\r
+ *<pre>\r
+       EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );\r
  </pre>\r
  *\r
  * Set bits within an event group.\r
@@ -344,9 +419,9 @@ xEventBitsType xEventGroupClearBits( xEventGroupHandle xEventGroup, xEventBitsTy
    #define BIT_0       ( 1 << 0 )\r
    #define BIT_4       ( 1 << 4 )\r
 \r
-   void aFunction( xEventGroupHandle xEventGroup )\r
+   void aFunction( EventGroupHandle_t xEventGroup )\r
    {\r
-   xEventBitsType uxBits;\r
+   EventBits_t uxBits;\r
 \r
                // Set bit 0 and bit 4 in xEventGroup.\r
                uxBits = xEventGroupSetBits(\r
@@ -374,20 +449,20 @@ xEventBitsType xEventGroupClearBits( xEventGroupHandle xEventGroup, xEventBitsTy
                else\r
                {\r
                        // Neither bit 0 nor bit 4 remained set.  It might be that a task\r
-                       // was waiting for either or both of the bits to be set, and the\r
-                       // bits were cleared as the task left the Blocked state.\r
+                       // was waiting for both of the bits to be set, and the bits were\r
+                       // cleared as the task left the Blocked state.\r
                }\r
    }\r
    </pre>\r
  * \defgroup xEventGroupSetBits xEventGroupSetBits\r
  * \ingroup EventGroup\r
  */\r
-xEventBitsType xEventGroupSetBits( xEventGroupHandle xEventGroup, xEventBitsType uxBitsToSet ) PRIVILEGED_FUNCTION;\r
+EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * event_groups.h\r
  *<pre>\r
-       xEventBitsType xEventGroupSetBitsFromISR( xEventGroupHandle xEventGroup, xEventBitsType uxBitsToSet, portBASE_TYPE *pxHigherPriorityTaskWoken );\r
+       BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken );\r
  </pre>\r
  *\r
  * A version of xEventGroupSetBits() that can be called from an interrupt.\r
@@ -406,60 +481,69 @@ xEventBitsType xEventGroupSetBits( xEventGroupHandle xEventGroup, xEventBitsType
  * For example, to set bit 3 only, set uxBitsToSet to 0x08.  To set bit 3\r
  * and bit 0 set uxBitsToSet to 0x09.\r
  *\r
- * @ pxHigherPriorityTaskWoken As mentioned above, calling this function will\r
- * result in a message being sent to the timer daemon task.  If the priority of\r
- * the timer daemon task is higher than the priority of the currently running\r
- * task (the task the interrupt interrupted) then *pxHigherPriorityTaskWoken\r
- * will be set to pdTRUE by xEventGroupSetBitsFromISR(), indicating that a\r
- * context switch should be requested before the interrupt exits.  For that\r
- * reason *pxHigherPriorityTaskWoken must be initialised to pdFALSE.  See the\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 is higher than the priority of the\r
+ * currently running task (the task the interrupt interrupted) then\r
+ * *pxHigherPriorityTaskWoken will be set to pdTRUE by\r
+ * xEventGroupSetBitsFromISR(), 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 If the callback request was registered successfully then pdPASS is\r
- * returned, otherwise pdFALSE is returned.  pdFALSE will be returned if the\r
- * timer service queue was full.\r
+ * @return If the request to execute the function was posted successfully then \r
+ * pdPASS is returned, otherwise pdFALSE is returned.  pdFALSE will be returned \r
+ * if the timer service queue was full.\r
  *\r
  * Example usage:\r
    <pre>\r
    #define BIT_0       ( 1 << 0 )\r
    #define BIT_4       ( 1 << 4 )\r
 \r
-   // An event group which it is assume has already been created by a call to\r
+   // An event group which it is assumed has already been created by a call to\r
    // xEventGroupCreate().\r
-   xEventGroupHandle xEventGroup;\r
+   EventGroupHandle_t xEventGroup;\r
 \r
    void anInterruptHandler( void )\r
    {\r
-   portBASE_TYPE xHigherPriorityTaskWoken;\r
+   BaseType_t xHigherPriorityTaskWoken, xResult;\r
 \r
-               // xHigherPriorityTaskWoken must be initialised to pdFALSE;\r
+               // xHigherPriorityTaskWoken must be initialised to pdFALSE.\r
                xHigherPriorityTaskWoken = pdFALSE;\r
 \r
                // Set bit 0 and bit 4 in xEventGroup.\r
-               uxBits = xEventGroupSetBitsFromISR(\r
+               xResult = xEventGroupSetBitsFromISR(\r
                                                        xEventGroup,    // The event group being updated.\r
                                                        BIT_0 | BIT_4   // The bits being set.\r
                                                        &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
+               // Was the message posted successfully?\r
+               if( xResult == pdPASS )\r
+               {\r
+                       // If xHigherPriorityTaskWoken is now set to pdTRUE then a context\r
+                       // switch should be requested.  The macro used is port specific and \r
+                       // will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - \r
+                       // refer to the documentation page for the port being used.\r
+                       portYIELD_FROM_ISR( xHigherPriorityTaskWoken );\r
+               }\r
+  }\r
    </pre>\r
  * \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR\r
  * \ingroup EventGroup\r
  */\r
-#define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) xTimerPendCallbackFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( unsigned long ) uxBitsToSet, pxHigherPriorityTaskWoken )\r
+#if( configUSE_TRACE_FACILITY == 1 )\r
+       BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;\r
+#else\r
+       #define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )\r
+#endif\r
 \r
 /**\r
  * event_groups.h\r
  *<pre>\r
-       xEventBitsType xEventGroupSync( xEventGroupHandle xEventGroup,\r
-                                                                       xEventBitsType uxBitsToSet,\r
-                                                                       xEventBitsType uxBitsToWaitFor,\r
-                                                                       portTickType xTicksToWait );\r
+       EventBits_t xEventGroupSync(    EventGroupHandle_t xEventGroup,\r
+                                                                       const EventBits_t uxBitsToSet,\r
+                                                                       const EventBits_t uxBitsToWaitFor,\r
+                                                                       TickType_t xTicksToWait );\r
  </pre>\r
  *\r
  * Atomically set bits within an event group, then wait for a combination of\r
@@ -509,12 +593,12 @@ xEventBitsType xEventGroupSetBits( xEventGroupHandle xEventGroup, xEventBitsType
 \r
  // Use an event group to synchronise three tasks.  It is assumed this event\r
  // group has already been created elsewhere.\r
xEventGroupHandle xEventBits;\r
EventGroupHandle_t xEventBits;\r
 \r
  void vTask0( void *pvParameters )\r
  {\r
xEventBitsType uxReturn;\r
portTickType xTicksToWait = 100 / portTICK_RATE_MS;\r
EventBits_t uxReturn;\r
TickType_t xTicksToWait = 100 / portTICK_PERIOD_MS;\r
 \r
         for( ;; )\r
         {\r
@@ -577,13 +661,13 @@ xEventBitsType xEventGroupSetBits( xEventGroupHandle xEventGroup, xEventBitsType
  * \defgroup xEventGroupSync xEventGroupSync\r
  * \ingroup EventGroup\r
  */\r
-xEventBitsType xEventGroupSync( xEventGroupHandle xEventGroup, xEventBitsType uxBitsToSet, xEventBitsType uxBitsToWaitFor, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
+EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
 \r
 \r
 /**\r
  * event_groups.h\r
  *<pre>\r
-       xEventBitsType xEventGroupGetBits( xEventGroupHandle xEventGroup );\r
+       EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup );\r
  </pre>\r
  *\r
  * Returns the current value of the bits in an event group.  This function\r
@@ -601,7 +685,24 @@ xEventBitsType xEventGroupSync( xEventGroupHandle xEventGroup, xEventBitsType ux
 /**\r
  * event_groups.h\r
  *<pre>\r
-       void xEventGroupDelete( xEventGroupHandle xEventGroup );\r
+       EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup );\r
+ </pre>\r
+ *\r
+ * A version of xEventGroupGetBits() that can be called from an ISR.\r
+ *\r
+ * @param xEventGroup The event group being queried.\r
+ *\r
+ * @return The event group bits at the time xEventGroupGetBitsFromISR() was called.\r
+ *\r
+ * \defgroup xEventGroupGetBitsFromISR xEventGroupGetBitsFromISR\r
+ * \ingroup EventGroup\r
+ */\r
+EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;\r
+\r
+/**\r
+ * event_groups.h\r
+ *<pre>\r
+       void xEventGroupDelete( EventGroupHandle_t xEventGroup );\r
  </pre>\r
  *\r
  * Delete an event group that was previously created by a call to\r
@@ -610,11 +711,15 @@ xEventBitsType xEventGroupSync( xEventGroupHandle xEventGroup, xEventBitsType ux
  *\r
  * @param xEventGroup The event group being deleted.\r
  */\r
-void vEventGroupDelete( xEventGroupHandle xEventGroup );\r
+void vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;\r
 \r
 /* For internal use only. */\r
-void vEventGroupSetBitsCallback( void *pvEventGroup, unsigned long ulBitsToSet );\r
+void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;\r
+void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;\r
 \r
+#if (configUSE_TRACE_FACILITY == 1)\r
+       UBaseType_t uxEventGroupGetNumber( void* xEventGroup ) PRIVILEGED_FUNCTION;\r
+#endif\r
 \r
 #ifdef __cplusplus\r
 }\r