mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-01 13:04:43 -04:00
Move event.* code into event_m[04].*.
Slightly more duplication of code now. Need a base class...
This commit is contained in:
parent
e73a9f98a1
commit
731cea1b96
11 changed files with 42 additions and 30 deletions
|
@ -66,6 +66,7 @@ public:
|
|||
painter(painter),
|
||||
context(context)
|
||||
{
|
||||
thread_event_loop = chThdSelf();
|
||||
touch_manager.on_event = [this](const ui::TouchEvent event) {
|
||||
this->on_touch_event(event);
|
||||
};
|
||||
|
@ -86,7 +87,21 @@ public:
|
|||
is_running = false;
|
||||
}
|
||||
|
||||
static inline void events_flag(const eventmask_t events) {
|
||||
if( thread_event_loop ) {
|
||||
chEvtSignal(thread_event_loop, events);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void events_flag_isr(const eventmask_t events) {
|
||||
if( thread_event_loop ) {
|
||||
chEvtSignalI(thread_event_loop, events);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static Thread* thread_event_loop;
|
||||
|
||||
touch::Manager touch_manager;
|
||||
ui::Widget* const top_widget;
|
||||
ui::Painter& painter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue