From e0371de24dac83fd30add51ae6d51ee2400d5a8e Mon Sep 17 00:00:00 2001 From: ziggurat29 Date: Thu, 5 May 2016 11:28:41 -0500 Subject: [PATCH] correct the RTC_ALRMR_ENABLE value, it needs to ignore the date/dow component since that is not set. Also, the prescaler value for HSE (which presumes 1 MHz, anyway) had transposed digits. --- arch/arm/src/stm32l4/stm32l4_rtcc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/stm32l4/stm32l4_rtcc.c b/arch/arm/src/stm32l4/stm32l4_rtcc.c index befe1043a2..072da11a8f 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtcc.c +++ b/arch/arm/src/stm32l4/stm32l4_rtcc.c @@ -114,8 +114,8 @@ (rtc_bin2bcd((tm)->tm_min) << RTC_ALRMR_MNU_SHIFT) | \ (rtc_bin2bcd((tm)->tm_hour) << RTC_ALRMR_HU_SHIFT)) -#define RTC_ALRMR_ENABLE (0) - +/* need to ignore DATE/DOW part of alarm; rtc_reg_alrmr_bin2bcd only encodes hms */ +#define RTC_ALRMR_ENABLE (0x80000000) /* Debug ****************************************************************************/ @@ -527,7 +527,7 @@ static int rtc_setup(void) * timer - which is pretty close. */ - putreg32(((uint32_t)7182 << RTC_PRER_PREDIV_S_SHIFT) | + putreg32(((uint32_t)7812 << RTC_PRER_PREDIV_S_SHIFT) | ((uint32_t)0x7f << RTC_PRER_PREDIV_A_SHIFT), STM32L4_RTC_PRER); #else