mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-20 16:47:32 +00:00
Add app-local MessageQueue.
This commit is contained in:
@@ -145,6 +145,10 @@ void EventDispatcher::dispatch(const eventmask_t events) {
|
||||
handle_application_queue();
|
||||
}
|
||||
|
||||
if( events & EVT_MASK_LOCAL ) {
|
||||
handle_local_queue();
|
||||
}
|
||||
|
||||
if( events & EVT_MASK_RTC_TICK ) {
|
||||
handle_rtc_tick();
|
||||
}
|
||||
@@ -174,6 +178,12 @@ void EventDispatcher::handle_application_queue() {
|
||||
});
|
||||
}
|
||||
|
||||
void EventDispatcher::handle_local_queue() {
|
||||
shared_memory.app_local_queue.handle([](Message* const message) {
|
||||
message_map.send(message);
|
||||
});
|
||||
}
|
||||
|
||||
void EventDispatcher::handle_rtc_tick() {
|
||||
sd_card::poll_inserted();
|
||||
|
||||
@@ -288,6 +298,9 @@ void EventDispatcher::init_message_queues() {
|
||||
new (&shared_memory.application_queue) MessageQueue(
|
||||
shared_memory.application_queue_data, SharedMemory::application_queue_k
|
||||
);
|
||||
new (&shared_memory.app_local_queue) MessageQueue(
|
||||
shared_memory.app_local_queue_data, SharedMemory::app_local_queue_k
|
||||
);
|
||||
}
|
||||
|
||||
MessageHandlerRegistration::MessageHandlerRegistration(
|
||||
|
Reference in New Issue
Block a user