]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/queue.h
Update QueueOverwrite.c to include a call to xQueuePeekFromISR().
[freertos] / FreeRTOS / Source / include / queue.h
index 915e2ab9988b7af6c6b400078b649f494e4b0708..315b67e25f91cfe6e7f15d9ee0b4597440878340 100644 (file)
@@ -616,7 +616,9 @@ signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const
  * Successfully received items remain on the queue so will be returned again\r
  * by the next call, or a call to xQueueReceive().\r
  *\r
- * This macro must not be used in an interrupt service routine.\r
+ * This macro must not be used in an interrupt service routine.  See\r
+ * xQueuePeekFromISR() for an alternative that can be called from an interrupt\r
+ * service routine.\r
  *\r
  * @param xQueue The handle to the queue from which the item is to be\r
  * received.\r
@@ -691,6 +693,39 @@ signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const
  */\r
 #define xQueuePeek( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdTRUE )\r
 \r
+/**\r
+ * queue. h\r
+ * <pre>\r
+ portBASE_TYPE xQueuePeekFromISR(\r
+                                                                       xQueueHandle xQueue,\r
+                                                                       void *pvBuffer,\r
+                                                               );</pre>\r
+ *\r
+ * A version of xQueuePeek() that can be called from an interrupt service\r
+ * routine (ISR).\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
+ * the queue was created.\r
+ *\r
+ * Successfully received items remain on the queue so will be returned again\r
+ * by the next call, or a call to xQueueReceive().\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
+ * @return pdTRUE if an item was successfully received from the queue,\r
+ * otherwise pdFALSE.\r
+ *\r
+ * \defgroup xQueuePeekFromISR xQueuePeekFromISR\r
+ * \ingroup QueueManagement\r
+ */\r
+signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, void * const pvBuffer );\r
+\r
 /**\r
  * queue. h\r
  * <pre>\r