diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/platforms/STM32/RTCv2/rtc_lld.c | 2 | ||||
-rw-r--r-- | os/hal/platforms/STM32/RTCv2/rtc_lld.h | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/os/hal/platforms/STM32/RTCv2/rtc_lld.c b/os/hal/platforms/STM32/RTCv2/rtc_lld.c index 6f7a93457..81393f8c6 100644 --- a/os/hal/platforms/STM32/RTCv2/rtc_lld.c +++ b/os/hal/platforms/STM32/RTCv2/rtc_lld.c @@ -109,7 +109,7 @@ void rtc_lld_init(void){ preload |= ((RTC_CLK / (PREDIV_A + 1)) - 1) & 0x7FFF;
/* Selects clock source (previously enabled and stabilized).*/
- RCC->BDCR = (RCC->BDCR & ~RCC_BDCR_RTCSEL) | STM32_RTC;
+ RCC->BDCR = (RCC->BDCR & ~RCC_BDCR_RTCSEL) | STM32_RTCSEL;
/* RTC enabled regardless its previous status.*/
RCC->BDCR |= RCC_BDCR_RTCEN;
diff --git a/os/hal/platforms/STM32/RTCv2/rtc_lld.h b/os/hal/platforms/STM32/RTCv2/rtc_lld.h index 08d58c898..f6526538f 100644 --- a/os/hal/platforms/STM32/RTCv2/rtc_lld.h +++ b/os/hal/platforms/STM32/RTCv2/rtc_lld.h @@ -40,11 +40,13 @@ /*===========================================================================*/
/**
- * @brief This RTC implementation supports callbacks.
+ * @brief This RTC implementation doesn't support callbacks.
*/
-#if !defined(RTC_SUPPORTS_CALLBACKS) || defined(__DOXYGEN__)
#define RTC_SUPPORTS_CALLBACKS FALSE
-#endif
+
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
/**
* @brief Two alarm comparators available on STM32F4x.
@@ -71,8 +73,9 @@ #error "RTC not present in the selected device"
#endif
-#if !(STM32_RTC == STM32_RTC_LSE) && !(STM32_RTC == STM32_RTC_LSI) && \
- !(STM32_RTC == STM32_RTC_HSE)
+#if !(STM32_RTCSEL == STM32_RTCSEL_LSE) && \
+ !(STM32_RTCSEL == STM32_RTCSEL_LSI) && \
+ !(STM32_RTCSEL == STM32_RTCSEL_HSEDIV)
#error "invalid source selected for RTC clock"
#endif
|