mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
stm32/usb: Add support to auto-detect USB interface, either FS or HS.
If both FS and HS USB peripherals are enabled for a board then the active one used for the REPL will now be auto-detected, by checking to see if both the DP and DM lines are actively pulled low. By default the code falls back to use MICROPY_HW_USB_MAIN_DEV if nothing can be detected.
This commit is contained in:
@@ -652,7 +652,7 @@ soft_reset:
|
||||
#if MICROPY_HW_ENABLE_USB
|
||||
// init USB device to default setting if it was not already configured
|
||||
if (!(pyb_usb_flags & PYB_USB_FLAG_USB_MODE_CALLED)) {
|
||||
pyb_usb_dev_init(USBD_VID, USBD_PID_CDC_MSC, USBD_MODE_CDC_MSC, 0, NULL, NULL);
|
||||
pyb_usb_dev_init(pyb_usb_dev_detect(), USBD_VID, USBD_PID_CDC_MSC, USBD_MODE_CDC_MSC, 0, NULL, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user