mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-23 22:39:22 -05:00
Use app-local queue for messages coming from application.
Messages are now deferred until application thread call stack unwinds, events are checked.
This commit is contained in:
parent
dbe735233a
commit
76c5fe96af
@ -119,10 +119,6 @@ void EventDispatcher::request_stop() {
|
||||
is_running = false;
|
||||
}
|
||||
|
||||
void EventDispatcher::send_message(Message* const message) {
|
||||
message_map.send(message);
|
||||
}
|
||||
|
||||
void EventDispatcher::set_display_sleep(const bool sleep) {
|
||||
// TODO: Distribute display sleep message more broadly, shut down data generation
|
||||
// on baseband side, since all that data is being discarded during sleep.
|
||||
|
@ -80,7 +80,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static void send_message(Message* const message);
|
||||
template<typename T>
|
||||
static void send_message(T& message) {
|
||||
shared_memory.app_local_queue.push(message);
|
||||
events_flag_isr(EVT_MASK_LOCAL);
|
||||
}
|
||||
|
||||
private:
|
||||
static constexpr auto EVT_MASK_RTC_TICK = EVENT_MASK(0);
|
||||
|
@ -63,7 +63,7 @@ SystemStatusView::SystemStatusView() {
|
||||
|
||||
button_sleep.on_select = [this](ImageButton&) {
|
||||
DisplaySleepMessage message;
|
||||
EventDispatcher::send_message(&message);
|
||||
EventDispatcher::send_message(message);
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user