Skip to content

Commit

Permalink
better location for wakeup delay
Browse files Browse the repository at this point in the history
  • Loading branch information
spidey3 committed Feb 1, 2021
1 parent f1fb386 commit cf51106
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 0 additions & 11 deletions tmk_core/protocol/chibios/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,6 @@ int main(void) {
/* Remote wakeup */
if (suspend_wakeup_condition()) {
usbWakeupHost(&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

restart_usb_driver(&USB_DRIVER);
}
}
Expand Down
11 changes: 11 additions & 0 deletions tmk_core/protocol/chibios/usb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,17 @@ void init_usb_driver(USBDriver *usbp) {
void restart_usb_driver(USBDriver *usbp) {
usbStop(usbp);
usbDisconnectBus(usbp);

#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

usbStart(usbp, &usbcfg);
usbConnectBus(usbp);
}
Expand Down

0 comments on commit cf51106

Please sign in to comment.