USB: use OTG1/OTG2 for serial over USB depending on which enabled (#3757)
This commit is contained in:
parent
29ec6d7381
commit
74b9ce8a8f
|
@ -26,10 +26,12 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if STM32_USB_USE_OTG2
|
||||
#if STM32_USB_USE_OTG1
|
||||
USBDriver *usb_driver = &USBD1;
|
||||
#elif STM32_USB_USE_OTG2
|
||||
USBDriver *usb_driver = &USBD2;
|
||||
#else
|
||||
USBDriver *usb_driver = &USBD1;
|
||||
#error MSD needs OTG1 or OTG2 to be enabled
|
||||
#endif
|
||||
|
||||
// One block buffer per LUN
|
||||
|
|
|
@ -451,7 +451,13 @@ const USBConfig usbcfg = {
|
|||
* Serial over USB driver configuration.
|
||||
*/
|
||||
const SerialUSBConfig serusbcfg = {
|
||||
#if STM32_USB_USE_OTG1
|
||||
.usbp = &USBD1,
|
||||
#elif STM32_USB_USE_OTG2
|
||||
.usbp = &USBD2,
|
||||
#else
|
||||
#error Serial over USB needs OTG1 or OTG2 to be enabled
|
||||
#endif
|
||||
.bulk_in = USBD1_DATA_REQUEST_EP,
|
||||
.bulk_out = USBD1_DATA_AVAILABLE_EP,
|
||||
.int_in = USBD1_INTERRUPT_REQUEST_EP
|
||||
|
|
Loading…
Reference in New Issue