hirohiro wrote on Thursday, August 01, 2019:
Hi all,
I’m trying to come up with an appropriate, and abstracted architecture for my next project and am leaning towards using and event bus of some sort throughout all my tasks/modules to signal/receive events. I don’t have much experience with FreeROTS, so I’m hoping someone can point me in the right direction or ideally tell me what what I’m looking for is already part of the OS
Example: Events would be flags with or without associated data that need to be passed around the application. I want to define a list of these events that can be signaled and received globally across the application. For example, a task monitoring reading & processing thermometer data could detect that a certain temperature has been reached (the event). At this point it would need to notify a number of modules aboout this, however, it shouldn’t be concerned about what those modules or tasks are. It should just signal the event and the other tasks (logger, UI, networking, state machine, etc…) would be notified about the event if they are interested and take action.
Details: This would have to be a many-to-many publish-subscribe type of model. Events should be publishable from critical sections (ie. interrupts), but should not result in being handled directly from that context (ie. direct callback wouldn’t work). Events should be disseminated to all interested parties before being cleared.
My Questions:
- Is there something that accomplishes this already available in FreeRTOS
- Is there something similar available that accomplishes this outside of FreeRTOS
- Is there a better/simpler mechanism/architecture to achieve IPC handling multiple tasks/modules that I may have overlooked?
Looking forward to hearing some thoughts!