mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-29 09:07:17 -04:00
Add app-local MessageQueue.
This commit is contained in:
parent
7023616808
commit
dbe735233a
3 changed files with 18 additions and 0 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue