]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/queue.h
Update TaskNotify.c to test the condition where a direct to task notification is...
[freertos] / FreeRTOS / Source / include / queue.h
index f4bc73ecf9a35e5657eb3fd9acee06683617dd8c..6d2aa0c02331ce1ce19bf2e06ae1faa01a5ad991 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
+    FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -696,12 +696,10 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQ
  * <pre>\r
  BaseType_t xQueuePeek(\r
                                                         QueueHandle_t xQueue,\r
-                                                        void *pvBuffer,\r
+                                                        void * const pvBuffer,\r
                                                         TickType_t xTicksToWait\r
                                                 );</pre>\r
  *\r
- * This is a macro that calls the xQueueGenericReceive() function.\r
- *\r
  * Receive an item from a queue without removing the item from the queue.\r
  * The item is received by copy so a buffer of adequate size must be\r
  * provided.  The number of bytes copied into the buffer was defined when\r
@@ -782,10 +780,10 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQ
        // ... Rest of task code.\r
  }\r
  </pre>\r
- * \defgroup xQueueReceive xQueueReceive\r
+ * \defgroup xQueuePeek xQueuePeek\r
  * \ingroup QueueManagement\r
  */\r
-#define xQueuePeek( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdTRUE )\r
+BaseType_t xQueuePeek( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * queue. h\r
@@ -829,8 +827,6 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer ) PRIV
                                                                 TickType_t xTicksToWait\r
                                                        );</pre>\r
  *\r
- * This is a macro that calls the xQueueGenericReceive() function.\r
- *\r
  * Receive an item from a queue.  The item is received by copy so a buffer of\r
  * adequate size must be provided.  The number of bytes copied into the buffer\r
  * was defined when the queue was created.\r
@@ -911,106 +907,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer ) PRIV
  * \defgroup xQueueReceive xQueueReceive\r
  * \ingroup QueueManagement\r
  */\r
-#define xQueueReceive( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE )\r
-\r
-\r
-/**\r
- * queue. h\r
- * <pre>\r
- BaseType_t xQueueGenericReceive(\r
-                                                                          QueueHandle_t        xQueue,\r
-                                                                          void *pvBuffer,\r
-                                                                          TickType_t   xTicksToWait\r
-                                                                          BaseType_t   xJustPeek\r
-                                                                       );</pre>\r
- *\r
- * It is preferred that the macro xQueueReceive() be used rather than calling\r
- * this function directly.\r
- *\r
- * Receive an item from a queue.  The item is received by copy so a buffer of\r
- * adequate size must be provided.  The number of bytes copied into the buffer\r
- * was defined when the queue was created.\r
- *\r
- * This function must not be used in an interrupt service routine.  See\r
- * xQueueReceiveFromISR for an alternative that can.\r
- *\r
- * @param xQueue The handle to the queue from which the item is to be\r
- * received.\r
- *\r
- * @param pvBuffer Pointer to the buffer into which the received item will\r
- * be copied.\r
- *\r
- * @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_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
- * @param xJustPeek When set to true, the item received from the queue is not\r
- * actually removed from the queue - meaning a subsequent call to\r
- * xQueueReceive() will return the same item.  When set to false, the item\r
- * being received from the queue is also removed from the queue.\r
- *\r
- * @return pdTRUE if an item was successfully received from the queue,\r
- * otherwise pdFALSE.\r
- *\r
- * Example usage:\r
-   <pre>\r
- struct AMessage\r
- {\r
-       char ucMessageID;\r
-       char ucData[ 20 ];\r
- } xMessage;\r
-\r
- QueueHandle_t xQueue;\r
-\r
- // Task to create a queue and post a value.\r
- void vATask( void *pvParameters )\r
- {\r
- struct AMessage *pxMessage;\r
-\r
-       // Create a queue capable of containing 10 pointers to AMessage structures.\r
-       // These should be passed by pointer as they contain a lot of data.\r
-       xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );\r
-       if( xQueue == 0 )\r
-       {\r
-               // Failed to create the queue.\r
-       }\r
-\r
-       // ...\r
-\r
-       // Send a pointer to a struct AMessage object.  Don't block if the\r
-       // queue is already full.\r
-       pxMessage = & xMessage;\r
-       xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );\r
-\r
-       // ... Rest of task code.\r
- }\r
-\r
- // Task to receive from the queue.\r
- void vADifferentTask( void *pvParameters )\r
- {\r
- struct AMessage *pxRxedMessage;\r
-\r
-       if( xQueue != 0 )\r
-       {\r
-               // Receive a message on the created queue.  Block for 10 ticks if a\r
-               // message is not immediately available.\r
-               if( xQueueGenericReceive( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )\r
-               {\r
-                       // pcRxedMessage now points to the struct AMessage variable posted\r
-                       // by vATask.\r
-               }\r
-       }\r
-\r
-       // ... Rest of task code.\r
- }\r
- </pre>\r
- * \defgroup xQueueReceive xQueueReceive\r
- * \ingroup QueueManagement\r
- */\r
-BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xJustPeek ) PRIVILEGED_FUNCTION;\r
+BaseType_t xQueueReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * queue. h\r
@@ -1560,7 +1457,9 @@ QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION
 QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue ) PRIVILEGED_FUNCTION;\r
 QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;\r
 QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue ) PRIVILEGED_FUNCTION;\r
+BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
 void* xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;\r
+void* xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * For internal use only.  Use xSemaphoreTakeMutexRecursive() or\r