RMT xRingbufferReceive lock function ?
Posted: Mon May 10, 2021 6:14 pm
Hi all,
I'm working with RMT, especially the receive function; I'm missing something..
once it enter in the part in case of no items, the loop stucks until "portMAX_DELAY" unlock it.
Is it possible to avoid this ?
Also, how do I check if the rx_size (in my case 1000) is big enough to handle my entries?
Thanks!
I'm working with RMT, especially the receive function; I'm missing something..
once it enter in the part
Code: Select all
items = (rmt_item32_t *) xRingbufferReceive(rb, &length, portMAX_DELAY);
Is it possible to avoid this ?
Code: Select all
//...settings channel etc..
RingbufHandle_t rb = NULL;
rmt_item32_t *items = NULL;
//get RMT RX ringbuffer
rmt_get_ringbuf_handle(example_rx_channel, &rb);
assert(rb != NULL);
// Start receive
rmt_rx_start(example_rx_channel, true);
while (1) {
items = (rmt_item32_t *) xRingbufferReceive(rb, &length, portMAX_DELAY);// this locks while until portMAX_DELAY in case of no items
if (items) {
//after parsing the data, return spaces to ringbuffer.
vRingbufferReturnItem(rb, (void *) items);
}
else{
break;
}
}
rmt_rx_stop(example_rx_channel);
Code: Select all
rmt_driver_install(example_rx_channel, 1000, 0); //in this case 1000