From fe86aae1bf97d96ba38e9424d60593c4e7a5f252 Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Sat, 25 Jun 2016 14:51:10 +0000 Subject: Edits to USB_CDC demo. Added USB voltage validation in hal_lld.c (still not backported) git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9663 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/STM32L4xx/hal_lld.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'os/hal/ports') diff --git a/os/hal/ports/STM32/STM32L4xx/hal_lld.c b/os/hal/ports/STM32/STM32L4xx/hal_lld.c index 730629c86..76433073c 100644 --- a/os/hal/ports/STM32/STM32L4xx/hal_lld.c +++ b/os/hal/ports/STM32/STM32L4xx/hal_lld.c @@ -111,6 +111,13 @@ void hal_lld_init(void) { #if STM32_PVD_ENABLE PWR->CR1 |= PWR_CR1_PVDE | (STM32_PLS & STM32_PLS_MASK); #endif /* STM32_PVD_ENABLE */ + + /* Validating USB VDD.*/ +#if HAL_USE_USB + PWR->CR2 = PWR_CR2_USV; +#else + PWR->CR2 = 0; +#endif /* STM32_PVD_ENABLE */ } /** -- cgit v1.2.3