added usb event to not wait for the next frame (#1733)

This commit is contained in:
Bernd Herzog 2024-01-07 14:09:22 +01:00 committed by GitHub
parent 23e6295dd2
commit 9d22711368
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 2 deletions

View file

@ -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