Skip to content

Commit

Permalink
drivers: counter: stm32: fix LSE clock source for not F4 SoC
Browse files Browse the repository at this point in the history
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 17, 2019
1 parent 91ca8aa commit a3ec56c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/counter/Kconfig.stm32_rtc
Expand Up @@ -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"
Expand Down
8 changes: 6 additions & 2 deletions drivers/counter/counter_ll_stm32_rtc.c
Expand Up @@ -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 */
Expand Down

0 comments on commit a3ec56c

Please sign in to comment.