From 32c276a7084141ea0e65f1fa4cd92146251958d6 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Tue, 5 Jul 2011 18:40:34 +0200 Subject: Move enabling the USB Clock into stm32f10x_usbd_init --- lib/usb/usb_f103.c | 2 ++ lib/usb/usb_f107.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/usb/usb_f103.c b/lib/usb/usb_f103.c index 19f645d..594d3c6 100644 --- a/lib/usb/usb_f103.c +++ b/lib/usb/usb_f103.c @@ -17,6 +17,7 @@ * along with this program. If not, see . */ +#include #include #include #include @@ -53,6 +54,7 @@ const struct _usbd_driver stm32f103_usb_driver = { /** Initialize the USB device controller hardware of the STM32. */ static void stm32f103_usbd_init(void) { + rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); SET_REG(USB_CNTR_REG, 0); SET_REG(USB_BTABLE_REG, 0); SET_REG(USB_ISTR_REG, 0); diff --git a/lib/usb/usb_f107.c b/lib/usb/usb_f107.c index ee83b65..134b728 100644 --- a/lib/usb/usb_f107.c +++ b/lib/usb/usb_f107.c @@ -17,6 +17,7 @@ * along with this program. If not, see . */ +#include #include #include #include @@ -63,6 +64,7 @@ const struct _usbd_driver stm32f107_usb_driver = { /** Initialize the USB device controller hardware of the STM32. */ static void stm32f107_usbd_init(void) { + rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_OTGFSEN); OTG_FS_GINTSTS = OTG_FS_GINTSTS_MMIS; /* WARNING: Undocumented! Select internal PHY */ -- cgit v1.2.3