ringbuf.h 22 KB

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