From 9d55b0877dbd2a79efac41ff83e851064361a54c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 23 Dec 2013 08:46:10 +0000 Subject: [PATCH] Added BOARD_OTG_NOVBUSSENS option. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6576 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/OTGv1/usb_lld.c | 5 +++++ os/hal/ports/STM32F4xx/hal_lld.h | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/os/hal/ports/STM32/OTGv1/usb_lld.c b/os/hal/ports/STM32/OTGv1/usb_lld.c index 433a75802..ce60435f9 100644 --- a/os/hal/ports/STM32/OTGv1/usb_lld.c +++ b/os/hal/ports/STM32/OTGv1/usb_lld.c @@ -773,7 +773,12 @@ void usb_lld_start(USBDriver *usbp) { otgp->PCGCCTL = 0; /* Internal FS PHY activation.*/ +#if defined(BOARD_OTG_NOVBUSSENS) + otgp->GCCFG = GCCFG_NOVBUSSENS | GCCFG_VBUSASEN | GCCFG_VBUSBSEN | + GCCFG_PWRDWN; +#else otgp->GCCFG = GCCFG_VBUSASEN | GCCFG_VBUSBSEN | GCCFG_PWRDWN; +#endif /* Soft core reset.*/ otg_core_reset(usbp); diff --git a/os/hal/ports/STM32F4xx/hal_lld.h b/os/hal/ports/STM32F4xx/hal_lld.h index 1729b687b..4bbf9f16b 100644 --- a/os/hal/ports/STM32F4xx/hal_lld.h +++ b/os/hal/ports/STM32F4xx/hal_lld.h @@ -818,9 +818,7 @@ #error "HSI not enabled, required by STM32_MCO1SEL" #endif -#if (STM32_MCO2SEL == STM32_MCO2SEL_HSI) || \ - ((STM32_MCO2SEL == STM32_MCO2SEL_PLL) && \ - (STM32_PLLSRC == STM32_PLLSRC_HSI)) +#if (STM32_MCO2SEL == STM32_MCO2SEL_PLL) && (STM32_PLLSRC == STM32_PLLSRC_HSI) #error "HSI not enabled, required by STM32_MCO2SEL" #endif