From a9552232e44774bf59a07db8b45f51852a07ff8c Mon Sep 17 00:00:00 2001 From: jeromecoutant Date: Mon, 22 Oct 2018 15:57:21 +0200 Subject: [PATCH] STM32 RTC : Prescaler calculation issue --- targets/TARGET_STM/rtc_api_hal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/TARGET_STM/rtc_api_hal.h b/targets/TARGET_STM/rtc_api_hal.h index 296ea9cec26..086e64dc988 100644 --- a/targets/TARGET_STM/rtc_api_hal.h +++ b/targets/TARGET_STM/rtc_api_hal.h @@ -81,7 +81,7 @@ void rtc_deactivate_wake_up_timer(void); /* PREDIV_S : 15-bit synchronous prescaler */ /* PREDIV_S is set in order to get a 1 Hz clock */ -#define PREDIV_S_VALUE RTC_CLOCK / (PREDIV_A_VALUE + 1) - 1 +#define PREDIV_S_VALUE (RTC_CLOCK / (PREDIV_A_VALUE + 1) - 1) /** Synchronise the RTC shadow registers. *