Skip to content
Permalink
Browse files

drivers: counter: stm32: fix LSE clock source for not F4 SoC

Fixes the STM32 counter driver when LSE is the clock source
and SoC is not F4.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
  • Loading branch information...
Georgij Cernysiov authored and galak committed Apr 12, 2019
1 parent 91ca8aa commit a3ec56c1ba3d26798807793127daacb386e48eb6
Showing with 7 additions and 3 deletions.
  1. +1 −1 drivers/counter/Kconfig.stm32_rtc
  2. +6 −2 drivers/counter/counter_ll_stm32_rtc.c
@@ -36,7 +36,7 @@ if !SOC_SERIES_STM32F4X

choice COUNTER_RTC_STM32_LSE_DRIVE
prompt "LSE oscillator drive capability"
depends on RTC_STM32_CLOCK_LSE
depends on COUNTER_RTC_STM32_CLOCK_LSE

config COUNTER_RTC_STM32_LSE_DRIVE_LOW
bool "Low"
@@ -275,10 +275,14 @@ static int rtc_stm32_init(struct device *dev)

#else /* CONFIG_COUNTER_RTC_STM32_CLOCK_LSE */

#ifndef(CONFIG_SOC_SERIES_STM32F4X)
#if !defined(CONFIG_SOC_SERIES_STM32F4X) && \
!defined(CONFIG_SOC_SERIES_STM32F2X)

LL_RCC_LSE_SetDriveCapability(
CONFIG_COUNTER_RTC_STM32_LSE_DRIVE_STRENGTH);
#endif /* !CONFIG_SOC_SERIES_STM32F4X */

#endif /* !CONFIG_SOC_SERIES_STM32F4X && !CONFIG_SOC_SERIES_STM32F2X */

LL_RCC_LSE_Enable();

/* Wait until LSE is ready */

0 comments on commit a3ec56c

Please sign in to comment.
You can’t perform that action at this time.