feat(esp_ringbuf): Update vRingbufferReset to return an error

when items are not sent, complete or returned, make the function
return an error instead of checking the state in an assert.
This commit is contained in:
Guillaume Souchere
2025-09-23 08:38:22 +02:00
parent 589d5b132d
commit c03987ca49
3 changed files with 13 additions and 7 deletions

View File

@@ -391,9 +391,10 @@ void vRingbufferReturnItemFromISR(RingbufHandle_t xRingbuffer, void *pvItem, Bas
*
* @param[in] xRingbuffer Ring buffer to reset
*
* @note Users must ensure that all buffers are returned before calling this function
* @return ESP_ERR_INVALID_STATE if one or more items are not sent, completed or returned
* ESP_OK if the operation was successful
*/
void vRingbufferReset(RingbufHandle_t xRingbuffer);
esp_err_t vRingbufferReset(RingbufHandle_t xRingbuffer);
/**
* @brief Delete a ring buffer