Page 1 of 1

RMT xRingbufferReceive lock function ?

Posted: Mon May 10, 2021 6:14 pm
by DEsp3286
Hi all,

I'm working with RMT, especially the receive function; I'm missing something.. :shock:

once it enter in the part

Code: Select all

items = (rmt_item32_t *) xRingbufferReceive(rb, &length, portMAX_DELAY);
in case of no items, the loop stucks until "portMAX_DELAY" unlock it.

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);
    
Also, how do I check if the rx_size (in my case 1000) is big enough to handle my entries?

Code: Select all

rmt_driver_install(example_rx_channel, 1000, 0); //in this case 1000
Thanks!

Re: RMT xRingbufferReceive lock function ?

Posted: Wed May 12, 2021 8:03 am
by Die_32_
Anyone has some hints?

Re: RMT xRingbufferReceive lock function ?

Posted: Tue May 18, 2021 1:46 pm
by Die_32_
How is the size defined? in bytes?