Эх сурвалжийг харах

f7: Disconnect USB ID resistor when hw_usb_deinit().

Keir Fraser 4 жил өмнө
parent
commit
977af4cd70
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      src/usb/hw_dwc_otg.c

+ 5 - 0
src/usb/hw_dwc_otg.c

@@ -277,6 +277,11 @@ void hw_usb_init(void)
 
 void hw_usb_deinit(void)
 {
+    /* HAL_PCD_Stop, USB_DevDisconnect */
+    otgd->dctl |= OTG_DCTL_SDIS;
+    peripheral_clock_delay();
+
+    /* HAL_PCD_MspDeInit */
     switch (conf_port) {
     case PORT_FS:
         gpio_configure_pin(gpioa, 11, GPI_floating);