[Core] Refactor ChibiOS USB endpoints to be fully async (#21656)
This commit is contained in:
parent
b43f6cb7ef
commit
0e02b0c41e
12 changed files with 1311 additions and 1134 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue