Provide a way to exit application event loop.

This commit is contained in:
Jared Boone 2015-08-20 17:56:47 -07:00
parent 9742a058e9
commit 2efbd337bd

View File

@ -67,18 +67,23 @@ public:
}
void run() {
while(true) {
while(is_running) {
const auto events = wait();
dispatch(events);
}
}
void request_stop() {
is_running = false;
}
private:
touch::Manager touch_manager;
ui::Widget* const top_widget;
ui::Painter& painter;
ui::Context& context;
uint32_t encoder_last = 0;
bool is_running = true;
eventmask_t wait() {
return chEvtWaitAny(ALL_EVENTS);