Complete the code to create a queue set with space for 3 queues.
QueueSetHandle_t xQueueSet = xQueueCreateSet([1]);The queue set must be created with the total number of messages it can hold. Here, 3 queues are monitored, so 3 is correct.
Complete the code to add a queue handle to the queue set.
xQueueAddToSet([1], xQueueSet);You add a queue handle (like xQueue1) to the queue set, not the set itself or other objects.
Fix the error in the code to receive from the queue set.
QueueSetMemberHandle_t xActivatedMember = xQueueSelectFromSet(xQueueSet, [1]);portMAX_DELAY waits indefinitely for a queue to have data. Using 0 would not wait, and -1 or NULL are invalid.
Fill both blanks to check if the activated member is a specific queue and then receive from it.
if (xActivatedMember == [1]) { xQueueReceive([2], &data, 0); }
You compare the activated member to the queue handle (xQueue1) and then receive from the same queue.
Fill all three blanks to create two queues, add them to a queue set, and then select from the set.
QueueHandle_t [1] = xQueueCreate(5, sizeof(int)); QueueHandle_t [2] = xQueueCreate(5, sizeof(int)); QueueSetHandle_t xQueueSet = xQueueCreateSet(10); xQueueAddToSet([3], xQueueSet); xQueueAddToSet([2], xQueueSet); QueueSetMemberHandle_t xActivatedMember = xQueueSelectFromSet(xQueueSet, portMAX_DELAY);
First, create xQueue1 and xQueue2. Then add xQueue1 and xQueue2 to the queue set. The blanks correspond to these names.
