RMT xRingbufferReceive lock function ?

DEsp3286
Posts: 13
Joined: Sat Sep 29, 2018 11:30 am

RMT xRingbufferReceive lock function ?

Postby DEsp3286 » Mon May 10, 2021 6:14 pm

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!

Die_32_
Posts: 58
Joined: Wed May 05, 2021 2:42 pm

Re: RMT xRingbufferReceive lock function ?

Postby Die_32_ » Wed May 12, 2021 8:03 am

Anyone has some hints?

Die_32_
Posts: 58
Joined: Wed May 05, 2021 2:42 pm

Re: RMT xRingbufferReceive lock function ?

Postby Die_32_ » Tue May 18, 2021 1:46 pm

How is the size defined? in bytes?

Who is online

Users browsing this forum: Bing [Bot], snutw_ and 128 guests