mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-27 16:56:15 -04:00
added usb event to not wait for the next frame (#1733)
This commit is contained in:
parent
23e6295dd2
commit
9d22711368
4 changed files with 22 additions and 2 deletions
|
@ -113,7 +113,6 @@ void EventDispatcher::run() {
|
|||
while (is_running) {
|
||||
const auto events = wait();
|
||||
dispatch(events);
|
||||
portapack::usb_serial.dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,6 +162,10 @@ void EventDispatcher::dispatch(const eventmask_t events) {
|
|||
handle_rtc_tick();
|
||||
}
|
||||
|
||||
if (events & EVT_MASK_USB) {
|
||||
handle_usb();
|
||||
}
|
||||
|
||||
if (events & EVT_MASK_SWITCHES) {
|
||||
handle_switches();
|
||||
}
|
||||
|
@ -216,6 +219,10 @@ void EventDispatcher::handle_rtc_tick() {
|
|||
portapack::persistent_memory::cache::persist();
|
||||
}
|
||||
|
||||
void EventDispatcher::handle_usb() {
|
||||
portapack::usb_serial.dispatch();
|
||||
}
|
||||
|
||||
ui::Widget* EventDispatcher::touch_widget(ui::Widget* const w, ui::TouchEvent event) {
|
||||
if (!w->hidden()) {
|
||||
// To achieve reverse depth ordering (last object drawn is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue