is there a way to send a "broadcast message" through a queue or "semaphore post" to more than one recipient at the same time, without sending the message to a single recipient with loop (for() or while()) ?
Thanks very much.
You can't do that using a semaphore, but you can using the new event groups implementation. Event groups are not in the current release, but can be obtained from SVN. See https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/include/event_groups.h for documentation.
Just what I needed for use multi-bit syncronize, like as uC-OS-xxx.
For send a message broadcast to multiple "message queue", there is something ?
Thanks very much.
Not directly, but you can create the same effect using event bits to have tasks wait on an event signally a post to a queue, then have each task peek the queue to get the message. You can use the queue overwrite function to have a single message in the queue that is updated by a writer.
The logic of broadcasting a message implies the message is copied individually to every task that is waiting, which is a lengthy and non-deterministic operation (FreeRTOS does not allow lengthy or non-deterministic operations). Without that (just copying the message to a single place) it would create logic problems for the application writer - what would happen if the tasks waiting for the message were of different priorities and the low priority tasks didn't get a chance to run before the message was updated? Etc. One day we may figure out small and deterministic ways of implementing these things without doing things like walking lists with interrupts disabled (or other such thing that is banned from the FreeRTOS implementation) and then provide it in the main code, but I can't say when that will be. Software timers and event bits have similar problems (anything basically that has to service a list of non-determinant length), but we are happy with the solutions we came up with for those, so there is no reason why we would not eventually do the same for broadcast messages. [you are able to do the opposite - that is - have a task wait for messages on multiple queues]
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.