mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-24 14:50:43 -04:00
Provide a way to exit application event loop.
This commit is contained in:
parent
9742a058e9
commit
2efbd337bd
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue