mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-09 07:32:47 -04:00
Add Shutdown message, plumbing to send and handle.
This commit is contained in:
parent
15791e345d
commit
690c3c98db
7 changed files with 58 additions and 11 deletions
|
@ -252,6 +252,13 @@ int main(void) {
|
|||
ui::Painter painter;
|
||||
EventDispatcher event_dispatcher { &system_view, painter, context };
|
||||
|
||||
auto& message_handlers = context.message_map;
|
||||
message_handlers.register_handler(Message::ID::Shutdown,
|
||||
[&event_dispatcher](const Message* const) {
|
||||
event_dispatcher.request_stop();
|
||||
}
|
||||
);
|
||||
|
||||
m4_init(portapack::spi_flash::baseband, portapack::memory::map::m4_code);
|
||||
|
||||
controls_init();
|
||||
|
@ -261,5 +268,7 @@ int main(void) {
|
|||
|
||||
event_dispatcher.run();
|
||||
|
||||
portapack::shutdown();
|
||||
m4_init(portapack::spi_flash::hackrf, portapack::memory::map::m4_code_hackrf);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue