Page 1 of 1

Pass array in FreeRTOS Queue

Posted: Fri Sep 27, 2019 7:45 am
by vignesh
:? can we pass array inside FreeRTOS Queue? If yes the how?

Re: Pass array in FreeRTOS Queue

Posted: Fri Sep 27, 2019 9:26 am
by WiFive
Pointer

Re: Pass array in FreeRTOS Queue

Posted: Sat Sep 28, 2019 2:53 am
by nickname
Hi,

I haven't tested it (yet, will do that tomorrow). But regarding the documentation, it's possible.

Upon queue creation, you specify the size of each item in bytes. The queue will allocate the maximum amount of storage right from the beginning, no matter how many items are actually stored. Items passed to the freertos queue are copied into the queue's internal memory allocated upon creation.

If you're using a system-provided queue, you have to use that data schema. If you create your own queue, you can specify arbitrary sizes and store your array. Of course, biggest limitation is the RAM, so chose the size wisely.

Source:
https://github.com/espressif/esp-idf/bl ... os/queue.h

Hope that helps!