fix(ringbuf): xRingbufferReceive() crashes for allow-split buffers

This commit adds an assert check to xRingbufferReceive() and
xRingbufferReceiveFromISR() functions to prevent them from being used to
retrieve items from an allow-split buffer. Corresponding documentation
has also been updated.
This commit is contained in:
Sudeep Mohanty
2025-03-19 12:09:08 +01:00
parent 711eda79ca
commit d62e07e8c0
4 changed files with 15 additions and 3 deletions

View File

@@ -296,6 +296,10 @@ Byte buffers **do not allow multiple retrievals before returning** (every retrie
Referring to the diagram above, the 38 bytes of continuous stored data at the tail of the buffer is retrieved, returned, and freed. The next call to :cpp:func:`xRingbufferReceive` or :cpp:func:`xRingbufferReceiveFromISR` then wraps around and does the same to the 30 bytes of continuous stored data at the head of the buffer.
.. note::
Retrieving items from Allow-Split buffers must be done via :cpp:func:`xRingbufferReceiveSplit` or :cpp:func:`xRingbufferReceiveSplitFromISR` instead of :cpp:func:`xRingbufferReceive` or :cpp:func:`xRingbufferReceiveFromISR`.
Ring Buffers with Queue Sets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^