summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/usb.c')
-rw-r--r--stmhal/usb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/stmhal/usb.c b/stmhal/usb.c
index fd8cbb95a1..ef7e8a62eb 100644
--- a/stmhal/usb.c
+++ b/stmhal/usb.c
@@ -75,6 +75,13 @@ void pyb_usb_dev_init(usb_device_mode_t mode, usb_storage_medium_t medium) {
#endif
}
+void pyb_usb_dev_stop(void) {
+ if (dev_is_enabled) {
+ USBD_Stop(&hUSBDDevice);
+ dev_is_enabled = 0;
+ }
+}
+
bool usb_vcp_is_enabled(void) {
return dev_is_enabled;
}