Pass array in FreeRTOS Queue
Pass array in FreeRTOS Queue
can we pass array inside FreeRTOS Queue? If yes the how?
Re: Pass array in FreeRTOS Queue
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!
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: Bing [Bot] and 180 guests