Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] ChibiOS: Fix USB bus disconnect handling #18566

Merged
merged 1 commit into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tmk_core/protocol/chibios/usb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ void init_usb_driver(USBDriver *usbp) {
* after a reset.
*/
usbDisconnectBus(usbp);
usbStop(usbp);
wait_ms(50);
usbStart(usbp, &usbcfg);
usbConnectBus(usbp);
Expand All @@ -742,8 +743,8 @@ void init_usb_driver(USBDriver *usbp) {
}

__attribute__((weak)) void restart_usb_driver(USBDriver *usbp) {
usbStop(usbp);
usbDisconnectBus(usbp);
usbStop(usbp);

#if USB_SUSPEND_WAKEUP_DELAY > 0
// Some hubs, kvm switches, and monitors do
Expand Down
1 change: 1 addition & 0 deletions tmk_core/protocol/chibios/usb_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "usb_util.h"

void usb_disconnect(void) {
usbDisconnectBus(&USBD1);
usbStop(&USBD1);
}

Expand Down