1
0
Fork 0

[Core] Refactor ChibiOS USB endpoints to be fully async (#21656)

This commit is contained in:
Stefan Kerkmann 2024-02-28 12:00:27 +01:00 committed by GitHub
parent b43f6cb7ef
commit 0e02b0c41e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 1311 additions and 1134 deletions

View file

@ -192,15 +192,18 @@ void protocol_pre_task(void) {
/* Remote wakeup */
if ((USB_DRIVER.status & USB_GETSTATUS_REMOTE_WAKEUP_ENABLED) && suspend_wakeup_condition()) {
usbWakeupHost(&USB_DRIVER);
restart_usb_driver(&USB_DRIVER);
# if USB_SUSPEND_WAKEUP_DELAY > 0
// Some hubs, kvm switches, and monitors do
// weird things, with USB device state bouncing
// around wildly on wakeup, yielding race
// conditions that can corrupt the keyboard state.
//
// Pause for a while to let things settle...
wait_ms(USB_SUSPEND_WAKEUP_DELAY);
# endif
}
}
/* Woken up */
// variables has been already cleared by the wakeup hook
send_keyboard_report();
# ifdef MOUSEKEY_ENABLE
mousekey_send();
# endif /* MOUSEKEY_ENABLE */
}
#endif
}
@ -218,4 +221,5 @@ void protocol_post_task(void) {
#ifdef RAW_ENABLE
raw_hid_task();
#endif
usb_idle_task();
}