Created
August 9, 2016 19:51
-
-
Save kuldeepdhaka/1a2f810dd47d611fd731b46a2774bb52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/usb/usb_f107.c b/lib/usb/usb_f107.c | |
index fb8ddf5..af98ddc 100644 | |
--- a/lib/usb/usb_f107.c | |
+++ b/lib/usb/usb_f107.c | |
@@ -55,8 +55,14 @@ static usbd_device *stm32f107_usbd_init(void) | |
OTG_FS_GINTSTS = OTG_GINTSTS_MMIS; | |
OTG_FS_GUSBCFG |= OTG_GUSBCFG_PHYSEL; | |
- /* Enable VBUS sensing in device mode and power down the PHY. */ | |
- OTG_FS_GCCFG |= OTG_GCCFG_VBUSBSEN | OTG_GCCFG_PWRDWN; | |
+ | |
+ /* Enable VBUS sensing in device mode and power down the PHY. | |
+ * note: bit VBDEN and NOVBUSSENS are same */ | |
+ OTG_FS_GCCFG |= OTG_GCCFG_PWRDWN | OTG_GCCFG_NOVBUSSENS | | |
+ OTG_GCCFG_VBUSASEN | OTG_GCCFG_VBUSBSEN; | |
+ | |
+ /* make sure that SDIS is low */ | |
+ OTG_FS_DCTL &= ~OTG_DCTL_SDIS; | |
/* Wait for AHB idle. */ | |
while (!(OTG_FS_GRSTCTL & OTG_GRSTCTL_AHBIDL)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see libopencm3/libopencm3#681 (comment)