ringbuf.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. // Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef FREERTOS_RINGBUF_H
  15. #define FREERTOS_RINGBUF_H
  16. #ifndef INC_FREERTOS_H
  17. #error "include FreeRTOS.h" must appear in source files before "include ringbuf.h"
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #include <freertos/queue.h>
  23. /**
  24. * Type by which ring buffers are referenced. For example, a call to xRingbufferCreate()
  25. * returns a RingbufHandle_t variable that can then be used as a parameter to
  26. * xRingbufferSend(), xRingbufferReceive(), etc.
  27. */
  28. typedef void * RingbufHandle_t;
  29. typedef enum {
  30. /**
  31. * No-split buffers will only store an item in contiguous memory and will
  32. * never split an item. Each item requires an 8 byte overhead for a header
  33. * and will always internally occupy a 32-bit aligned size of space.
  34. */
  35. RINGBUF_TYPE_NOSPLIT = 0,
  36. /**
  37. * Allow-split buffers will split an item into two parts if necessary in
  38. * order to store it. Each item requires an 8 byte overhead for a header,
  39. * splitting incurs an extra header. Each item will always internally occupy
  40. * a 32-bit aligned size of space.
  41. */
  42. RINGBUF_TYPE_ALLOWSPLIT,
  43. /**
  44. * Byte buffers store data as a sequence of bytes and do not maintain separate
  45. * items, therefore byte buffers have no overhead. All data is stored as a
  46. * sequence of byte and any number of bytes can be sent or retrieved each
  47. * time.
  48. */
  49. RINGBUF_TYPE_BYTEBUF,
  50. RINGBUF_TYPE_MAX,
  51. } RingbufferType_t;
  52. /**
  53. * @brief Struct that is equivalent in size to the ring buffer's data structure
  54. *
  55. * The contents of this struct are not meant to be used directly. This
  56. * structure is meant to be used when creating a statically allocated ring
  57. * buffer where this struct is of the exact size required to store a ring
  58. * buffer's control data structure.
  59. *
  60. */
  61. #if ( configSUPPORT_STATIC_ALLOCATION == 1)
  62. typedef struct xSTATIC_RINGBUFFER {
  63. /** @cond */ //Doxygen command to hide this structure from API Reference
  64. size_t xDummy1[2];
  65. UBaseType_t uxDummy2;
  66. BaseType_t xDummy3;
  67. void *pvDummy4[11];
  68. StaticSemaphore_t xDummy5[2];
  69. portMUX_TYPE muxDummy;
  70. /** @endcond */
  71. } StaticRingbuffer_t;
  72. #endif
  73. /**
  74. * @brief Create a ring buffer
  75. *
  76. * @param[in] xBufferSize Size of the buffer in bytes. Note that items require
  77. * space for overhead in no-split/allow-split buffers
  78. * @param[in] xBufferType Type of ring buffer, see documentation.
  79. *
  80. * @note xBufferSize of no-split/allow-split buffers will be rounded up to the nearest 32-bit aligned size.
  81. *
  82. * @return A handle to the created ring buffer, or NULL in case of error.
  83. */
  84. RingbufHandle_t xRingbufferCreate(size_t xBufferSize, RingbufferType_t xBufferType);
  85. /**
  86. * @brief Create a ring buffer of type RINGBUF_TYPE_NOSPLIT for a fixed item_size
  87. *
  88. * This API is similar to xRingbufferCreate(), but it will internally allocate
  89. * additional space for the headers.
  90. *
  91. * @param[in] xItemSize Size of each item to be put into the ring buffer
  92. * @param[in] xItemNum Maximum number of items the buffer needs to hold simultaneously
  93. *
  94. * @return A RingbufHandle_t handle to the created ring buffer, or NULL in case of error.
  95. */
  96. RingbufHandle_t xRingbufferCreateNoSplit(size_t xItemSize, size_t xItemNum);
  97. /**
  98. * @brief Create a ring buffer but manually provide the required memory
  99. *
  100. * @param[in] xBufferSize Size of the buffer in bytes.
  101. * @param[in] xBufferType Type of ring buffer, see documentation
  102. * @param[in] pucRingbufferStorage Pointer to the ring buffer's storage area.
  103. * Storage area must of the same size as specified by xBufferSize
  104. * @param[in] pxStaticRingbuffer Pointed to a struct of type StaticRingbuffer_t
  105. * which will be used to hold the ring buffer's data structure
  106. *
  107. * @note xBufferSize of no-split/allow-split buffers MUST be 32-bit aligned.
  108. *
  109. * @return A handle to the created ring buffer
  110. */
  111. #if ( configSUPPORT_STATIC_ALLOCATION == 1)
  112. RingbufHandle_t xRingbufferCreateStatic(size_t xBufferSize,
  113. RingbufferType_t xBufferType,
  114. uint8_t *pucRingbufferStorage,
  115. StaticRingbuffer_t *pxStaticRingbuffer);
  116. #endif
  117. /**
  118. * @brief Insert an item into the ring buffer
  119. *
  120. * Attempt to insert an item into the ring buffer. This function will block until
  121. * enough free space is available or until it times out.
  122. *
  123. * @param[in] xRingbuffer Ring buffer to insert the item into
  124. * @param[in] pvItem Pointer to data to insert. NULL is allowed if xItemSize is 0.
  125. * @param[in] xItemSize Size of data to insert.
  126. * @param[in] xTicksToWait Ticks to wait for room in the ring buffer.
  127. *
  128. * @note For no-split/allow-split ring buffers, the actual size of memory that
  129. * the item will occupy will be rounded up to the nearest 32-bit aligned
  130. * size. This is done to ensure all items are always stored in 32-bit
  131. * aligned fashion.
  132. *
  133. * @return
  134. * - pdTRUE if succeeded
  135. * - pdFALSE on time-out or when the data is larger than the maximum permissible size of the buffer
  136. */
  137. BaseType_t xRingbufferSend(RingbufHandle_t xRingbuffer,
  138. const void *pvItem,
  139. size_t xItemSize,
  140. TickType_t xTicksToWait);
  141. /**
  142. * @brief Insert an item into the ring buffer in an ISR
  143. *
  144. * Attempt to insert an item into the ring buffer from an ISR. This function
  145. * will return immediately if there is insufficient free space in the buffer.
  146. *
  147. * @param[in] xRingbuffer Ring buffer to insert the item into
  148. * @param[in] pvItem Pointer to data to insert. NULL is allowed if xItemSize is 0.
  149. * @param[in] xItemSize Size of data to insert.
  150. * @param[out] pxHigherPriorityTaskWoken Value pointed to will be set to pdTRUE if the function woke up a higher priority task.
  151. *
  152. * @note For no-split/allow-split ring buffers, the actual size of memory that
  153. * the item will occupy will be rounded up to the nearest 32-bit aligned
  154. * size. This is done to ensure all items are always stored in 32-bit
  155. * aligned fashion.
  156. *
  157. * @return
  158. * - pdTRUE if succeeded
  159. * - pdFALSE when the ring buffer does not have space.
  160. */
  161. BaseType_t xRingbufferSendFromISR(RingbufHandle_t xRingbuffer,
  162. const void *pvItem,
  163. size_t xItemSize,
  164. BaseType_t *pxHigherPriorityTaskWoken);
  165. /**
  166. * @brief Acquire memory from the ring buffer to be written to by an external
  167. * source and to be sent later.
  168. *
  169. * Attempt to allocate buffer for an item to be sent into the ring buffer. This
  170. * function will block until enough free space is available or until it
  171. * timesout.
  172. *
  173. * The item, as well as the following items ``SendAcquire`` or ``Send`` after it,
  174. * will not be able to be read from the ring buffer until this item is actually
  175. * sent into the ring buffer.
  176. *
  177. * @param[in] xRingbuffer Ring buffer to allocate the memory
  178. * @param[out] ppvItem Double pointer to memory acquired (set to NULL if no memory were retrieved)
  179. * @param[in] xItemSize Size of item to acquire.
  180. * @param[in] xTicksToWait Ticks to wait for room in the ring buffer.
  181. *
  182. * @note Only applicable for no-split ring buffers now, the actual size of
  183. * memory that the item will occupy will be rounded up to the nearest 32-bit
  184. * aligned size. This is done to ensure all items are always stored in 32-bit
  185. * aligned fashion.
  186. *
  187. * @return
  188. * - pdTRUE if succeeded
  189. * - pdFALSE on time-out or when the data is larger than the maximum permissible size of the buffer
  190. */
  191. BaseType_t xRingbufferSendAcquire(RingbufHandle_t xRingbuffer, void **ppvItem, size_t xItemSize, TickType_t xTicksToWait);
  192. /**
  193. * @brief Actually send an item into the ring buffer allocated before by
  194. * ``xRingbufferSendAcquire``.
  195. *
  196. * @param[in] xRingbuffer Ring buffer to insert the item into
  197. * @param[in] pvItem Pointer to item in allocated memory to insert.
  198. *
  199. * @note Only applicable for no-split ring buffers. Only call for items
  200. * allocated by ``xRingbufferSendAcquire``.
  201. *
  202. * @return
  203. * - pdTRUE if succeeded
  204. * - pdFALSE if fail for some reason.
  205. */
  206. BaseType_t xRingbufferSendComplete(RingbufHandle_t xRingbuffer, void *pvItem);
  207. /**
  208. * @brief Retrieve an item from the ring buffer
  209. *
  210. * Attempt to retrieve an item from the ring buffer. This function will block
  211. * until an item is available or until it times out.
  212. *
  213. * @param[in] xRingbuffer Ring buffer to retrieve the item from
  214. * @param[out] pxItemSize Pointer to a variable to which the size of the retrieved item will be written.
  215. * @param[in] xTicksToWait Ticks to wait for items in the ring buffer.
  216. *
  217. * @note A call to vRingbufferReturnItem() is required after this to free the item retrieved.
  218. *
  219. * @return
  220. * - Pointer to the retrieved item on success; *pxItemSize filled with the length of the item.
  221. * - NULL on timeout, *pxItemSize is untouched in that case.
  222. */
  223. void *xRingbufferReceive(RingbufHandle_t xRingbuffer, size_t *pxItemSize, TickType_t xTicksToWait);
  224. /**
  225. * @brief Retrieve an item from the ring buffer in an ISR
  226. *
  227. * Attempt to retrieve an item from the ring buffer. This function returns immediately
  228. * if there are no items available for retrieval
  229. *
  230. * @param[in] xRingbuffer Ring buffer to retrieve the item from
  231. * @param[out] pxItemSize Pointer to a variable to which the size of the
  232. * retrieved item will be written.
  233. *
  234. * @note A call to vRingbufferReturnItemFromISR() is required after this to free the item retrieved.
  235. * @note Byte buffers do not allow multiple retrievals before returning an item
  236. * @note Two calls to RingbufferReceiveFromISR() are required if the bytes wrap around the end of the ring buffer.
  237. *
  238. * @return
  239. * - Pointer to the retrieved item on success; *pxItemSize filled with the length of the item.
  240. * - NULL when the ring buffer is empty, *pxItemSize is untouched in that case.
  241. */
  242. void *xRingbufferReceiveFromISR(RingbufHandle_t xRingbuffer, size_t *pxItemSize);
  243. /**
  244. * @brief Retrieve a split item from an allow-split ring buffer
  245. *
  246. * Attempt to retrieve a split item from an allow-split ring buffer. If the item
  247. * is not split, only a single item is retried. If the item is split, both parts
  248. * will be retrieved. This function will block until an item is available or
  249. * until it times out.
  250. *
  251. * @param[in] xRingbuffer Ring buffer to retrieve the item from
  252. * @param[out] ppvHeadItem Double pointer to first part (set to NULL if no items were retrieved)
  253. * @param[out] ppvTailItem Double pointer to second part (set to NULL if item is not split)
  254. * @param[out] pxHeadItemSize Pointer to size of first part (unmodified if no items were retrieved)
  255. * @param[out] pxTailItemSize Pointer to size of second part (unmodified if item is not split)
  256. * @param[in] xTicksToWait Ticks to wait for items in the ring buffer.
  257. *
  258. * @note Call(s) to vRingbufferReturnItem() is required after this to free up the item(s) retrieved.
  259. * @note This function should only be called on allow-split buffers
  260. *
  261. * @return
  262. * - pdTRUE if an item (split or unsplit) was retrieved
  263. * - pdFALSE when no item was retrieved
  264. */
  265. BaseType_t xRingbufferReceiveSplit(RingbufHandle_t xRingbuffer,
  266. void **ppvHeadItem,
  267. void **ppvTailItem,
  268. size_t *pxHeadItemSize,
  269. size_t *pxTailItemSize,
  270. TickType_t xTicksToWait);
  271. /**
  272. * @brief Retrieve a split item from an allow-split ring buffer in an ISR
  273. *
  274. * Attempt to retrieve a split item from an allow-split ring buffer. If the item
  275. * is not split, only a single item is retried. If the item is split, both parts
  276. * will be retrieved. This function returns immediately if there are no items
  277. * available for retrieval
  278. *
  279. * @param[in] xRingbuffer Ring buffer to retrieve the item from
  280. * @param[out] ppvHeadItem Double pointer to first part (set to NULL if no items were retrieved)
  281. * @param[out] ppvTailItem Double pointer to second part (set to NULL if item is not split)
  282. * @param[out] pxHeadItemSize Pointer to size of first part (unmodified if no items were retrieved)
  283. * @param[out] pxTailItemSize Pointer to size of second part (unmodified if item is not split)
  284. *
  285. * @note Calls to vRingbufferReturnItemFromISR() is required after this to free up the item(s) retrieved.
  286. * @note This function should only be called on allow-split buffers
  287. *
  288. * @return
  289. * - pdTRUE if an item (split or unsplit) was retrieved
  290. * - pdFALSE when no item was retrieved
  291. */
  292. BaseType_t xRingbufferReceiveSplitFromISR(RingbufHandle_t xRingbuffer,
  293. void **ppvHeadItem,
  294. void **ppvTailItem,
  295. size_t *pxHeadItemSize,
  296. size_t *pxTailItemSize);
  297. /**
  298. * @brief Retrieve bytes from a byte buffer, specifying the maximum amount of bytes to retrieve
  299. *
  300. * Attempt to retrieve data from a byte buffer whilst specifying a maximum number
  301. * of bytes to retrieve. This function will block until there is data available
  302. * for retrieval or until it times out.
  303. *
  304. * @param[in] xRingbuffer Ring buffer to retrieve the item from
  305. * @param[out] pxItemSize Pointer to a variable to which the size of the retrieved item will be written.
  306. * @param[in] xTicksToWait Ticks to wait for items in the ring buffer.
  307. * @param[in] xMaxSize Maximum number of bytes to return.
  308. *
  309. * @note A call to vRingbufferReturnItem() is required after this to free up the data retrieved.
  310. * @note This function should only be called on byte buffers
  311. * @note Byte buffers do not allow multiple retrievals before returning an item
  312. * @note Two calls to RingbufferReceiveUpTo() are required if the bytes wrap around the end of the ring buffer.
  313. *
  314. * @return
  315. * - Pointer to the retrieved item on success; *pxItemSize filled with
  316. * the length of the item.
  317. * - NULL on timeout, *pxItemSize is untouched in that case.
  318. */
  319. void *xRingbufferReceiveUpTo(RingbufHandle_t xRingbuffer,
  320. size_t *pxItemSize,
  321. TickType_t xTicksToWait,
  322. size_t xMaxSize);
  323. /**
  324. * @brief Retrieve bytes from a byte buffer, specifying the maximum amount of
  325. * bytes to retrieve. Call this from an ISR.
  326. *
  327. * Attempt to retrieve bytes from a byte buffer whilst specifying a maximum number
  328. * of bytes to retrieve. This function will return immediately if there is no data
  329. * available for retrieval.
  330. *
  331. * @param[in] xRingbuffer Ring buffer to retrieve the item from
  332. * @param[out] pxItemSize Pointer to a variable to which the size of the retrieved item will be written.
  333. * @param[in] xMaxSize Maximum number of bytes to return.
  334. *
  335. * @note A call to vRingbufferReturnItemFromISR() is required after this to free up the data received.
  336. * @note This function should only be called on byte buffers
  337. * @note Byte buffers do not allow multiple retrievals before returning an item
  338. *
  339. * @return
  340. * - Pointer to the retrieved item on success; *pxItemSize filled with
  341. * the length of the item.
  342. * - NULL when the ring buffer is empty, *pxItemSize is untouched in that case.
  343. */
  344. void *xRingbufferReceiveUpToFromISR(RingbufHandle_t xRingbuffer, size_t *pxItemSize, size_t xMaxSize);
  345. /**
  346. * @brief Return a previously-retrieved item to the ring buffer
  347. *
  348. * @param[in] xRingbuffer Ring buffer the item was retrieved from
  349. * @param[in] pvItem Item that was received earlier
  350. *
  351. * @note If a split item is retrieved, both parts should be returned by calling this function twice
  352. */
  353. void vRingbufferReturnItem(RingbufHandle_t xRingbuffer, void *pvItem);
  354. /**
  355. * @brief Return a previously-retrieved item to the ring buffer from an ISR
  356. *
  357. * @param[in] xRingbuffer Ring buffer the item was retrieved from
  358. * @param[in] pvItem Item that was received earlier
  359. * @param[out] pxHigherPriorityTaskWoken Value pointed to will be set to pdTRUE
  360. * if the function woke up a higher priority task.
  361. *
  362. * @note If a split item is retrieved, both parts should be returned by calling this function twice
  363. */
  364. void vRingbufferReturnItemFromISR(RingbufHandle_t xRingbuffer, void *pvItem, BaseType_t *pxHigherPriorityTaskWoken);
  365. /**
  366. * @brief Delete a ring buffer
  367. *
  368. * @param[in] xRingbuffer Ring buffer to delete
  369. *
  370. * @note This function will not deallocate any memory if the ring buffer was
  371. * created using xRingbufferCreateStatic(). Deallocation must be done
  372. * manually be the user.
  373. */
  374. void vRingbufferDelete(RingbufHandle_t xRingbuffer);
  375. /**
  376. * @brief Get maximum size of an item that can be placed in the ring buffer
  377. *
  378. * This function returns the maximum size an item can have if it was placed in
  379. * an empty ring buffer.
  380. *
  381. * @param[in] xRingbuffer Ring buffer to query
  382. *
  383. * @note The max item size for a no-split buffer is limited to
  384. * ((buffer_size/2)-header_size). This limit is imposed so that an item
  385. * of max item size can always be sent to the an empty no-split buffer
  386. * regardless of the internal positions of the buffer's read/write/free
  387. * pointers.
  388. *
  389. * @return Maximum size, in bytes, of an item that can be placed in a ring buffer.
  390. */
  391. size_t xRingbufferGetMaxItemSize(RingbufHandle_t xRingbuffer);
  392. /**
  393. * @brief Get current free size available for an item/data in the buffer
  394. *
  395. * This gives the real time free space available for an item/data in the ring
  396. * buffer. This represents the maximum size an item/data can have if it was
  397. * currently sent to the ring buffer.
  398. *
  399. * @warning This API is not thread safe. So, if multiple threads are accessing
  400. * the same ring buffer, it is the application's responsibility to
  401. * ensure atomic access to this API and the subsequent Send
  402. *
  403. * @note An empty no-split buffer has a max current free size for an item
  404. * that is limited to ((buffer_size/2)-header_size). See API reference
  405. * for xRingbufferGetMaxItemSize().
  406. *
  407. * @param[in] xRingbuffer Ring buffer to query
  408. *
  409. * @return Current free size, in bytes, available for an entry
  410. */
  411. size_t xRingbufferGetCurFreeSize(RingbufHandle_t xRingbuffer);
  412. /**
  413. * @brief Add the ring buffer's read semaphore to a queue set.
  414. *
  415. * The ring buffer's read semaphore indicates that data has been written
  416. * to the ring buffer. This function adds the ring buffer's read semaphore to
  417. * a queue set.
  418. *
  419. * @param[in] xRingbuffer Ring buffer to add to the queue set
  420. * @param[in] xQueueSet Queue set to add the ring buffer's read semaphore to
  421. *
  422. * @return
  423. * - pdTRUE on success, pdFALSE otherwise
  424. */
  425. BaseType_t xRingbufferAddToQueueSetRead(RingbufHandle_t xRingbuffer, QueueSetHandle_t xQueueSet);
  426. /**
  427. * @brief Check if the selected queue set member is the ring buffer's read semaphore
  428. *
  429. * This API checks if queue set member returned from xQueueSelectFromSet()
  430. * is the read semaphore of this ring buffer. If so, this indicates the ring buffer
  431. * has items waiting to be retrieved.
  432. *
  433. * @param[in] xRingbuffer Ring buffer which should be checked
  434. * @param[in] xMember Member returned from xQueueSelectFromSet
  435. *
  436. * @return
  437. * - pdTRUE when semaphore belongs to ring buffer
  438. * - pdFALSE otherwise.
  439. */
  440. BaseType_t xRingbufferCanRead(RingbufHandle_t xRingbuffer, QueueSetMemberHandle_t xMember);
  441. /**
  442. * @brief Remove the ring buffer's read semaphore from a queue set.
  443. *
  444. * This specifically removes a ring buffer's read semaphore from a queue set. The
  445. * read semaphore is used to indicate when data has been written to the ring buffer
  446. *
  447. * @param[in] xRingbuffer Ring buffer to remove from the queue set
  448. * @param[in] xQueueSet Queue set to remove the ring buffer's read semaphore from
  449. *
  450. * @return
  451. * - pdTRUE on success
  452. * - pdFALSE otherwise
  453. */
  454. BaseType_t xRingbufferRemoveFromQueueSetRead(RingbufHandle_t xRingbuffer, QueueSetHandle_t xQueueSet);
  455. /**
  456. * @brief Get information about ring buffer status
  457. *
  458. * Get information of the a ring buffer's current status such as
  459. * free/read/write pointer positions, and number of items waiting to be retrieved.
  460. * Arguments can be set to NULL if they are not required.
  461. *
  462. * @param[in] xRingbuffer Ring buffer to remove from the queue set
  463. * @param[out] uxFree Pointer use to store free pointer position
  464. * @param[out] uxRead Pointer use to store read pointer position
  465. * @param[out] uxWrite Pointer use to store write pointer position
  466. * @param[out] uxAcquire Pointer use to store acquire pointer position
  467. * @param[out] uxItemsWaiting Pointer use to store number of items (bytes for byte buffer) waiting to be retrieved
  468. */
  469. void vRingbufferGetInfo(RingbufHandle_t xRingbuffer,
  470. UBaseType_t *uxFree,
  471. UBaseType_t *uxRead,
  472. UBaseType_t *uxWrite,
  473. UBaseType_t *uxAcquire,
  474. UBaseType_t *uxItemsWaiting);
  475. /**
  476. * @brief Debugging function to print the internal pointers in the ring buffer
  477. *
  478. * @param xRingbuffer Ring buffer to show
  479. */
  480. void xRingbufferPrintInfo(RingbufHandle_t xRingbuffer);
  481. #ifdef __cplusplus
  482. }
  483. #endif
  484. #endif /* FREERTOS_RINGBUF_H */