From c16a51d87ccce560d6f85f9aa54117401735ba25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bora=20=C3=96zgen?= Date: Tue, 6 Apr 2021 13:45:52 +0200 Subject: [PATCH] STM32 RTC: Apply review changes for HSE support * Remove unused code * Fix supported target families * Add preprocessor error for wrong LPTICKER configuration --- targets/TARGET_STM/rtc_api_hal.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/targets/TARGET_STM/rtc_api_hal.h b/targets/TARGET_STM/rtc_api_hal.h index b670aa9e8a..b3e2f97a51 100644 --- a/targets/TARGET_STM/rtc_api_hal.h +++ b/targets/TARGET_STM/rtc_api_hal.h @@ -47,7 +47,7 @@ extern "C" { #error "RTC clock configuration is invalid!" #endif -#if (MBED_CONF_TARGET_RTC_CLOCK_SOURCE == USE_RTC_CLK_HSE) && !(TARGET_STM32F2 || TARGET_STM32F3 || TARGET_STM32F4) +#if (MBED_CONF_TARGET_RTC_CLOCK_SOURCE == USE_RTC_CLK_HSE) && !(TARGET_STM32F2 || TARGET_STM32F4 || TARGET_STM32F7) #error "RTC from HSE not supported for this target" #endif @@ -64,13 +64,14 @@ extern "C" { #endif #if DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM + +#if (MBED_CONF_TARGET_RTC_CLOCK_SOURCE == USE_RTC_CLK_HSE) +#error "LPTICKER is not available with HSE as RTC clock source and should be removed from the target configuration." +#endif + /* PREDIV_A : 7-bit asynchronous prescaler */ /* PREDIV_A is set to set LPTICKER frequency to RTC_CLOCK/4 */ -#if (MBED_CONF_TARGET_RTC_CLOCK_SOURCE == USE_RTC_CLK_HSE) -#define PREDIV_A_VALUE 124 -#else #define PREDIV_A_VALUE 3 -#endif /** Read RTC counter with sub second precision *