Event Library
An event is like a message. Multiple senders can send the message but only one subscriber can wait for and receive it.
|
In the example provided, there are 2 events, myEvent1 and myEvent2.
The example uses a semaphore to manage the serial console. For an introduction to semaphore, please refer to Semaphore Library. |
Only a single Task can wait for a given Event object at a time.
|
Simple Event
AND Condition for Events
Events can carry conditions, and wait for all the conditions to be met (AND condition), or wait for any of a list of conditions is sent (OR condition).
|
OR Condition for Events
Conclusion
The events offer an elegant solution to send messages with conditions to trigger actions. When the program is waiting for an event, it enters low power mode.
|
Only a single Task can wait for a given Event object at a time |
Posted: Apr 08, 2016