stm32f4: Enable USB peripheral, fix typos in register writes.

This commit is contained in:
William D. Jones
2019-01-13 17:34:09 -05:00
parent 03cbd406cb
commit 657d3e2983
2 changed files with 13 additions and 6 deletions

View File

@@ -78,7 +78,9 @@ bool dcd_init (uint8_t rhport)
USB_OTG_FS->GINTMSK |= USB_OTG_GINTMSK_USBRST | USB_OTG_GINTMSK_ENUMDNEM | \
USB_OTG_GINTMSK_ESUSPM | USB_OTG_GINTMSK_USBSUSPM | \
USB_OTG_GINTMSK_SOFM;
USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSBSEN; // Enable pullup.
// Enable pullup, enable peripheral.
USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSBSEN | USB_OTG_GCCFG_PWRDWN;
return true;
}