ringbuf: Fix warnings seen when CONFIG_FREERTOS_ASSERT_DISABLE=y
Signed-off-by: Piyush Shah <piyush@espressif.com>
This commit is contained in:
parent
1c3dd23fe0
commit
b66d80ed95
|
@ -404,9 +404,8 @@ static void returnItemToRingbufDefault(ringbuf_t *rb, void *item) {
|
||||||
//can be increase.
|
//can be increase.
|
||||||
//This function by itself is not threadsafe, always call from within a muxed section.
|
//This function by itself is not threadsafe, always call from within a muxed section.
|
||||||
static void returnItemToRingbufBytebuf(ringbuf_t *rb, void *item) {
|
static void returnItemToRingbufBytebuf(ringbuf_t *rb, void *item) {
|
||||||
uint8_t *data=(uint8_t*)item;
|
configASSERT((uint8_t *)item >= rb->data);
|
||||||
configASSERT(data >= rb->data);
|
configASSERT((uint8_t *)item < rb->data+rb->size);
|
||||||
configASSERT(data < rb->data+rb->size);
|
|
||||||
//Free the read memory.
|
//Free the read memory.
|
||||||
rb->free_ptr=rb->read_ptr;
|
rb->free_ptr=rb->read_ptr;
|
||||||
}
|
}
|
||||||
|
@ -692,10 +691,9 @@ void *xRingbufferReceiveFromISR(RingbufHandle_t ringbuf, size_t *item_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
void *xRingbufferReceiveUpTo(RingbufHandle_t ringbuf, size_t *item_size, TickType_t ticks_to_wait, size_t wanted_size) {
|
void *xRingbufferReceiveUpTo(RingbufHandle_t ringbuf, size_t *item_size, TickType_t ticks_to_wait, size_t wanted_size) {
|
||||||
ringbuf_t *rb=(ringbuf_t *)ringbuf;
|
|
||||||
if (wanted_size == 0) return NULL;
|
if (wanted_size == 0) return NULL;
|
||||||
configASSERT(rb);
|
configASSERT(ringbuf);
|
||||||
configASSERT(rb->flags & flag_bytebuf);
|
configASSERT(((ringbuf_t *)ringbuf)->flags & flag_bytebuf);
|
||||||
return xRingbufferReceiveGeneric(ringbuf, item_size, ticks_to_wait, wanted_size);
|
return xRingbufferReceiveGeneric(ringbuf, item_size, ticks_to_wait, wanted_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue