summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tmk_core/protocol/chibios/usb_main.c3
-rw-r--r--tmk_core/protocol/chibios/usb_util.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index 7c44b87bc4..3e64ceab19 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -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);
@@ -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
diff --git a/tmk_core/protocol/chibios/usb_util.c b/tmk_core/protocol/chibios/usb_util.c
index c8b435db0c..a8c7d9a228 100644
--- a/tmk_core/protocol/chibios/usb_util.c
+++ b/tmk_core/protocol/chibios/usb_util.c
@@ -17,6 +17,7 @@
#include "usb_util.h"
void usb_disconnect(void) {
+ usbDisconnectBus(&USBD1);
usbStop(&USBD1);
}