]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/queue.h
Update version numbers in preparation for new release.
[freertos] / FreeRTOS / Source / include / queue.h
index 1d86d2e16826019f280729216abcabc037c2b6bc..4ab7fd9e37dbb99e0eccfa42db9d077f2e83e280 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
@@ -92,10 +96,10 @@ typedef void * QueueSetHandle_t;
 \r
 /**\r
  * Queue sets can contain both queues and semaphores, so the\r
- * QueueSetMember_t is defined as a type to be used where a parameter or\r
+ * QueueSetMemberHandle_t is defined as a type to be used where a parameter or\r
  * return value can be either an QueueHandle_t or an SemaphoreHandle_t.\r
  */\r
-typedef void * QueueSetMember_t;\r
+typedef void * QueueSetMemberHandle_t;\r
 \r
 /* For internal use only. */\r
 #define        queueSEND_TO_BACK               ( ( BaseType_t ) 0 )\r
@@ -173,8 +177,8 @@ typedef void * QueueSetMember_t;
  * <pre>\r
  BaseType_t xQueueSendToToFront(\r
                                                                   QueueHandle_t        xQueue,\r
-                                                                  const void   *       pvItemToQueue,\r
-                                                                  TickType_t   xTicksToWait\r
+                                                                  const void           *pvItemToQueue,\r
+                                                                  TickType_t           xTicksToWait\r
                                                           );\r
  * </pre>\r
  *\r
@@ -196,7 +200,7 @@ typedef void * QueueSetMember_t;
  * waiting for space to become available on the queue, should it already\r
  * be full.  The call will return immediately if this is set to 0 and the\r
  * queue is full.  The time is defined in tick periods so the constant\r
- * portTICK_RATE_MS should be used to convert to real time if this is required.\r
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.\r
  *\r
  * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.\r
  *\r
@@ -278,7 +282,7 @@ typedef void * QueueSetMember_t;
  * waiting for space to become available on the queue, should it already\r
  * be full.  The call will return immediately if this is set to 0 and the queue\r
  * is full.  The  time is defined in tick periods so the constant\r
- * portTICK_RATE_MS should be used to convert to real time if this is required.\r
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.\r
  *\r
  * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.\r
  *\r
@@ -362,7 +366,7 @@ typedef void * QueueSetMember_t;
  * waiting for space to become available on the queue, should it already\r
  * be full.  The call will return immediately if this is set to 0 and the\r
  * queue is full.  The time is defined in tick periods so the constant\r
- * portTICK_RATE_MS should be used to convert to real time if this is required.\r
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.\r
  *\r
  * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.\r
  *\r
@@ -529,7 +533,7 @@ typedef void * QueueSetMember_t;
  * waiting for space to become available on the queue, should it already\r
  * be full.  The call will return immediately if this is set to 0 and the\r
  * queue is full.  The time is defined in tick periods so the constant\r
- * portTICK_RATE_MS should be used to convert to real time if this is required.\r
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.\r
  *\r
  * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the\r
  * item at the back of the queue, or queueSEND_TO_FRONT to place the item\r
@@ -619,7 +623,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQ
  * @param xTicksToWait The maximum amount of time the task should block\r
  * waiting for an item to receive should the queue be empty at the time\r
  * of the call.         The time is defined in tick periods so the constant\r
- * portTICK_RATE_MS should be used to convert to real time if this is required.\r
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.\r
  * xQueuePeek() will return immediately if xTicksToWait is 0 and the queue\r
  * is empty.\r
  *\r
@@ -746,7 +750,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer ) PRIV
  * waiting for an item to receive should the queue be empty at the time\r
  * of the call.         xQueueReceive() will return immediately if xTicksToWait\r
  * is zero and the queue is empty.  The time is defined in tick periods so the\r
- * constant portTICK_RATE_MS should be used to convert to real time if this is\r
+ * constant portTICK_PERIOD_MS should be used to convert to real time if this is\r
  * required.\r
  *\r
  * @return pdTRUE if an item was successfully received from the queue,\r
@@ -839,7 +843,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer ) PRIV
  * @param xTicksToWait The maximum amount of time the task should block\r
  * waiting for an item to receive should the queue be empty at the time\r
  * of the call.         The time is defined in tick periods so the constant\r
- * portTICK_RATE_MS should be used to convert to real time if this is required.\r
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.\r
  * xQueueGenericReceive() will return immediately if the queue is empty and\r
  * xTicksToWait is 0.\r
  *\r
@@ -1269,7 +1273,8 @@ uint32_t ulVarToSend, ulValReceived;
  *\r
  * It is preferred that the macros xQueueSendFromISR(),\r
  * xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place\r
- * of calling this function directly.\r
+ * of calling this function directly.  xQueueGiveFromISR() is an\r
+ * equivalent for use by semaphores that don't actually copy any data.\r
  *\r
  * Post an item on a queue.  It is safe to use this function from within an\r
  * interrupt service routine.\r
@@ -1333,6 +1338,7 @@ uint32_t ulVarToSend, ulValReceived;
  * \ingroup QueueManagement\r
  */\r
 BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue, const void * const pvItemToQueue, BaseType_t * const pxHigherPriorityTaskWoken, const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;\r
+BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue, BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * queue. h\r
@@ -1370,7 +1376,7 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue, const void * const pv
  void vAFunction( void *pvParameters )\r
  {\r
  char cValueToPost;\r
- const TickType_t xBlockTime = ( TickType_t )0xff;\r
+ const TickType_t xTicksToWait = ( TickType_t )0xff;\r
 \r
        // Create a queue capable of containing 10 characters.\r
        xQueue = xQueueCreate( 10, sizeof( char ) );\r
@@ -1382,17 +1388,17 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue, const void * const pv
        // ...\r
 \r
        // Post some characters that will be used within an ISR.  If the queue\r
-       // is full then this task will block for xBlockTime ticks.\r
+       // is full then this task will block for xTicksToWait ticks.\r
        cValueToPost = 'a';\r
-       xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );\r
+       xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );\r
        cValueToPost = 'b';\r
-       xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );\r
+       xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );\r
 \r
        // ... keep posting characters ... this task may block when the queue\r
        // becomes full.\r
 \r
        cValueToPost = 'c';\r
-       xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );\r
+       xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );\r
  }\r
 \r
  // ISR that outputs all the characters received on the queue.\r
@@ -1446,8 +1452,8 @@ UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEG
  * responsiveness to gain execution speed, whereas the fully featured API\r
  * sacrifices execution speed to ensure better interrupt responsiveness.\r
  */\r
-BaseType_t xQueueAltGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, BaseType_t xCopyPosition );\r
-BaseType_t xQueueAltGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking );\r
+BaseType_t xQueueAltGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;\r
+BaseType_t xQueueAltGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking ) PRIVILEGED_FUNCTION;\r
 #define xQueueAltSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )\r
 #define xQueueAltSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )\r
 #define xQueueAltReceive( xQueue, pvBuffer, xTicksToWait ) xQueueAltGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE )\r
@@ -1480,14 +1486,12 @@ void* xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
  * For internal use only.  Use xSemaphoreTakeMutexRecursive() or\r
  * xSemaphoreGiveMutexRecursive() instead of calling these functions directly.\r
  */\r
-BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xBlockTime ) PRIVILEGED_FUNCTION;\r
+BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
 BaseType_t xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
- * Reset a queue back to its original empty state.  pdPASS is returned if the\r
- * queue is successfully reset.  pdFAIL is returned if the queue could not be\r
- * reset because there are tasks blocked on the queue waiting to either\r
- * receive from the queue or send to the queue.\r
+ * Reset a queue back to its original empty state.  The return value is now\r
+ * obsolete and is always set to pdPASS.\r
  */\r
 #define xQueueReset( xQueue ) xQueueGenericReset( xQueue, pdFALSE )\r
 \r
@@ -1514,7 +1518,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) PRIVILEGED_FUNCTION
  * preferably in ROM/Flash), not on the stack.\r
  */\r
 #if configQUEUE_REGISTRY_SIZE > 0\r
-       void vQueueAddToRegistry( QueueHandle_t xQueue, char *pcName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+       void vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
 #endif\r
 \r
 /*\r
@@ -1599,7 +1603,7 @@ QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILE
  * a call to xQueueSelectFromSet() has first returned a handle to that set member.\r
  *\r
  * @param xQueueOrSemaphore The handle of the queue or semaphore being added to\r
- * the queue set (cast to an QueueSetMember_t type).\r
+ * the queue set (cast to an QueueSetMemberHandle_t type).\r
  *\r
  * @param xQueueSet The handle of the queue set to which the queue or semaphore\r
  * is being added.\r
@@ -1609,7 +1613,7 @@ QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILE
  * queue set because it is already a member of a different queue set then pdFAIL\r
  * is returned.\r
  */\r
-BaseType_t xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;\r
+BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Removes a queue or semaphore from a queue set.  A queue or semaphore can only\r
@@ -1619,7 +1623,7 @@ BaseType_t xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t
  * function.\r
  *\r
  * @param xQueueOrSemaphore The handle of the queue or semaphore being removed\r
- * from the queue set (cast to an QueueSetMember_t type).\r
+ * from the queue set (cast to an QueueSetMemberHandle_t type).\r
  *\r
  * @param xQueueSet The handle of the queue set in which the queue or semaphore\r
  * is included.\r
@@ -1628,7 +1632,7 @@ BaseType_t xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t
  * then pdPASS is returned.  If the queue was not in the queue set, or the\r
  * queue (or semaphore) was not empty, then pdFAIL is returned.\r
  */\r
-BaseType_t xQueueRemoveFromSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;\r
+BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * xQueueSelectFromSet() selects from the members of a queue set a queue or\r
@@ -1653,26 +1657,26 @@ BaseType_t xQueueRemoveFromSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHand
  *\r
  * @param xQueueSet The queue set on which the task will (potentially) block.\r
  *\r
- * @param xBlockTimeTicks The maximum time, in ticks, that the calling task will\r
+ * @param xTicksToWait The maximum time, in ticks, that the calling task will\r
  * remain in the Blocked state (with other tasks executing) to wait for a member\r
  * of the queue set to be ready for a successful queue read or semaphore take\r
  * operation.\r
  *\r
  * @return xQueueSelectFromSet() will return the handle of a queue (cast to\r
- * a QueueSetMember_t type) contained in the queue set that contains data,\r
- * or the handle of a semaphore (cast to a QueueSetMember_t type) contained\r
+ * a QueueSetMemberHandle_t type) contained in the queue set that contains data,\r
+ * or the handle of a semaphore (cast to a QueueSetMemberHandle_t type) contained\r
  * in the queue set that is available, or NULL if no such queue or semaphore\r
  * exists before before the specified block time expires.\r
  */\r
-QueueSetMember_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xBlockTimeTicks ) PRIVILEGED_FUNCTION;\r
+QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * A version of xQueueSelectFromSet() that can be used from an ISR.\r
  */\r
-QueueSetMember_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;\r
+QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;\r
 \r
 /* Not public API functions. */\r
-void vQueueWaitForMessageRestricted( QueueHandle_t xQueue, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
+void vQueueWaitForMessageRestricted( QueueHandle_t xQueue, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;\r
 BaseType_t xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;\r
 void vQueueSetQueueNumber( QueueHandle_t xQueue, UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;\r
 UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;\r