]> granicus.if.org Git - esp-idf/commitdiff
ringbuf: Fixes to header files for better understanding
authorPiyush Shah <piyush@espressif.com>
Fri, 17 Nov 2017 10:20:49 +0000 (15:50 +0530)
committerPiyush Shah <piyush@espressif.com>
Tue, 21 Nov 2017 11:46:04 +0000 (17:16 +0530)
1. Usage of this module required applications to include additional
files. What files to include is not very intuitive. Instead, it is
better for the header file itself to include other files as required.
2. Even though it may seem logical, it is better to explicitly mention
that an item needs to be "Returned" after a Receive

Signed-off-by: Piyush Shah <piyush@espressif.com>
components/freertos/include/freertos/ringbuf.h

index 93ba30758e79311cfbb923edcf93804fcbb29a2f..2449cc193694e81910f0e9bd2445ecfe8e0bb3e7 100644 (file)
@@ -36,6 +36,8 @@ maximum size is (buffer_size/2)-8 bytes. The bytebuf can fill the entire buffer
 no overhead.
 */
 
+#include <freertos/queue.h>
+
 //An opaque handle for a ringbuff object.
 typedef void * RingbufHandle_t;
 
@@ -110,6 +112,8 @@ BaseType_t xRingbufferSendFromISR(RingbufHandle_t ringbuf, void *data, size_t da
 /**
  * @brief  Retrieve an item from the ring buffer
  *
+ * @note A call to vRingbufferReturnItem() is required after this to free up the data received.
+ *
  * @param  ringbuf - Ring buffer to retrieve the item from
  * @param  item_size - Pointer to a variable to which the size of the retrieved item will be written.
  * @param  xTicksToWait - Ticks to wait for items in the ringbuffer.
@@ -123,6 +127,8 @@ void *xRingbufferReceive(RingbufHandle_t ringbuf, size_t *item_size, TickType_t
 /**
  * @brief  Retrieve an item from the ring buffer from an ISR
  *
+ * @note A call to vRingbufferReturnItemFromISR() is required after this to free up the data received
+ *
  * @param  ringbuf - Ring buffer to retrieve the item from
  * @param  item_size - Pointer to a variable to which the size of the retrieved item will be written.
  *
@@ -135,6 +141,8 @@ void *xRingbufferReceiveFromISR(RingbufHandle_t ringbuf, size_t *item_size);
 /**
  * @brief  Retrieve bytes from a ByteBuf type of ring buffer, specifying the maximum amount of bytes
  * to return
+
+ * @note A call to vRingbufferReturnItem() is required after this to free up the data received.
  *
  * @param  ringbuf - Ring buffer to retrieve the item from
  * @param  item_size - Pointer to a variable to which the size of the retrieved item will be written.
@@ -150,6 +158,8 @@ void *xRingbufferReceiveUpTo(RingbufHandle_t ringbuf, size_t *item_size, TickTyp
  * @brief  Retrieve bytes from a ByteBuf type of ring buffer, specifying the maximum amount of bytes
  * to return. Call this from an ISR.
  *
+ * @note A call to vRingbufferReturnItemFromISR() is required after this to free up the data received
+ *
  * @param  ringbuf - Ring buffer to retrieve the item from
  * @param  item_size - Pointer to a variable to which the size of the retrieved item will be written.
  *