Pass array in FreeRTOS Queue

vignesh
Posts: 1
Joined: Fri Sep 27, 2019 7:34 am

Pass array in FreeRTOS Queue

Postby vignesh » Fri Sep 27, 2019 7:45 am

:? can we pass array inside FreeRTOS Queue? If yes the how?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Pass array in FreeRTOS Queue

Postby WiFive » Fri Sep 27, 2019 9:26 am

Pointer

nickname
Posts: 5
Joined: Sat Sep 28, 2019 2:37 am

Re: Pass array in FreeRTOS Queue

Postby nickname » Sat Sep 28, 2019 2:53 am

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!

Who is online

Users browsing this forum: Google [Bot] and 65 guests