From 0a3c31495e264b010180a5ec627bcff98e9c0501 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 7 Jan 2012 07:36:07 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3756 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/RTCv2/rtc_lld.c | 2 +- os/hal/platforms/STM32/RTCv2/rtc_lld.h | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'os') 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 -- cgit v1.2.3