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-20 11:48:59 +01:00
parent 5cbd2a3877
commit 3f5f6ec13e
4 changed files with 15 additions and 3 deletions
+2
View File
@@ -1104,6 +1104,7 @@ void *xRingbufferReceive(RingbufHandle_t xRingbuffer, size_t *pxItemSize, TickTy
//Check arguments
configASSERT(pxRingbuffer && pxItemSize);
configASSERT((pxRingbuffer->uxRingbufferFlags & rbALLOW_SPLIT_FLAG) == 0); // This function must not be called for allow-split buffers
//Attempt to retrieve an item
void *pvTempItem;
@@ -1120,6 +1121,7 @@ void *xRingbufferReceiveFromISR(RingbufHandle_t xRingbuffer, size_t *pxItemSize)
//Check arguments
configASSERT(pxRingbuffer && pxItemSize);
configASSERT((pxRingbuffer->uxRingbufferFlags & rbALLOW_SPLIT_FLAG) == 0); // This function must not be called for allow-split buffers
//Attempt to retrieve an item
void *pvTempItem;