128 return 1u <<
static_cast<uint8_t
>(type);
136 struct Subscription {
143 void* queue_ =
nullptr;
144 bool initialized_ =
false;
void unsubscribe(uint8_t id)
Removes subscription by handler ID.
static EventBus & instance()
Returns singleton event-bus instance.
static constexpr size_t DEFAULT_QUEUE_SIZE
static constexpr size_t MAX_HANDLERS
bool publish(const Event &event, bool fromISR=false)
Publishes an event to the queue.
static constexpr uint32_t eventMask(EventType type)
void process()
Drains queued events and dispatches matching handlers.
uint8_t subscribe(EventHandler handler, uint32_t mask=0)
Subscribes an event handler with optional type mask.
bool init(size_t queueSize=DEFAULT_QUEUE_SIZE)
Initializes event queue and internal state.
void(*)(const Event &) EventHandler
union cdc::core::Event::@234350273243204124075032151001065005273232113040 data