From c64bdaf6190868f95f463015f28541b4ebf230ef Mon Sep 17 00:00:00 2001 From: barthess Date: Mon, 14 May 2012 17:40:44 +0000 Subject: RTC. Fixed bug 3526084 git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4196 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/RTCv2/rtc_lld.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'os/hal') diff --git a/os/hal/platforms/STM32/RTCv2/rtc_lld.c b/os/hal/platforms/STM32/RTCv2/rtc_lld.c index 870734fba..84295bd76 100644 --- a/os/hal/platforms/STM32/RTCv2/rtc_lld.c +++ b/os/hal/platforms/STM32/RTCv2/rtc_lld.c @@ -105,8 +105,10 @@ void rtc_lld_init(void){ rtc_lld_enter_init(); /* Prescaler register must be written in two SEPARATE writes. */ - RTCD1.id_rtc->PRER = prediv_a << 16; - RTCD1.id_rtc->PRER = ((STM32_RTCCLK / (prediv_a + 1)) - 1) & 0x7FFF; + prediv_a = (prediv_a << 16) | + (((STM32_RTCCLK / (prediv_a + 1)) - 1) & 0x7FFF); + RTCD1.id_rtc->PRER = prediv_a; + RTCD1.id_rtc->PRER = prediv_a; rtc_lld_exit_init(); } } -- cgit v1.2.3