mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-13 20:35:42 +00:00
Provide a way to exit application event loop.
This commit is contained in:
@@ -67,18 +67,23 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void run() {
|
void run() {
|
||||||
while(true) {
|
while(is_running) {
|
||||||
const auto events = wait();
|
const auto events = wait();
|
||||||
dispatch(events);
|
dispatch(events);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void request_stop() {
|
||||||
|
is_running = false;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
touch::Manager touch_manager;
|
touch::Manager touch_manager;
|
||||||
ui::Widget* const top_widget;
|
ui::Widget* const top_widget;
|
||||||
ui::Painter& painter;
|
ui::Painter& painter;
|
||||||
ui::Context& context;
|
ui::Context& context;
|
||||||
uint32_t encoder_last = 0;
|
uint32_t encoder_last = 0;
|
||||||
|
bool is_running = true;
|
||||||
|
|
||||||
eventmask_t wait() {
|
eventmask_t wait() {
|
||||||
return chEvtWaitAny(ALL_EVENTS);
|
return chEvtWaitAny(ALL_EVENTS);
|
||||||
|
Reference in New Issue
Block a user