aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-01-12 10:27:42 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-01-12 10:27:42 +0000
commit0db56fc105f39b7652254199e754fba58bb3b1f6 (patch)
tree1775c067c75c701fb724d7dc71e918cd2fe8ab81 /os/hal/ports
parentba1d40843994392b6d12f09fb16bee3c23195679 (diff)
downloadChibiOS-0db56fc105f39b7652254199e754fba58bb3b1f6.tar.gz
ChibiOS-0db56fc105f39b7652254199e754fba58bb3b1f6.tar.bz2
ChibiOS-0db56fc105f39b7652254199e754fba58bb3b1f6.zip
Fixed RTC clock enable on some F4 devices.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10036 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports')
-rw-r--r--os/hal/ports/STM32/STM32F4xx/hal_lld.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/STM32F4xx/hal_lld.c b/os/hal/ports/STM32/STM32F4xx/hal_lld.c
index 91e3c1367..69767e8c4 100644
--- a/os/hal/ports/STM32/STM32F4xx/hal_lld.c
+++ b/os/hal/ports/STM32/STM32F4xx/hal_lld.c
@@ -150,7 +150,11 @@ void stm32_clock_init(void) {
#if !STM32_NO_INIT
/* PWR clock enable.*/
+#if defined(HAL_USE_RTC) && defined(RCC_APB1ENR_RTCAPBEN)
+ RCC->APB1ENR = RCC_APB1ENR_PWREN | RCC_APB1ENR_RTCAPBEN;
+#else
RCC->APB1ENR = RCC_APB1ENR_PWREN;
+#endif
/* PWR initialization.*/
#if defined(STM32F4XX) || defined(__DOXYGEN__)