From f1e7205055499651f51f6f7af86e407201dc1b1c Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sat, 30 Sep 2023 00:12:19 +0200 Subject: [PATCH] stm32/rtc: enable lse in examples. --- examples/stm32l4/src/bin/rtc.rs | 1 + examples/stm32wl/src/bin/rtc.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/examples/stm32l4/src/bin/rtc.rs b/examples/stm32l4/src/bin/rtc.rs index f3f8aa46..eb1eed01 100644 --- a/examples/stm32l4/src/bin/rtc.rs +++ b/examples/stm32l4/src/bin/rtc.rs @@ -23,6 +23,7 @@ async fn main(_spawner: Spawner) { PLLMul::Mul20, None, ); + config.rcc.lse = Some(Hertz(32_768)); config.rcc.rtc_mux = rcc::RtcClockSource::LSE; embassy_stm32::init(config) }; diff --git a/examples/stm32wl/src/bin/rtc.rs b/examples/stm32wl/src/bin/rtc.rs index e123425a..11734e4b 100644 --- a/examples/stm32wl/src/bin/rtc.rs +++ b/examples/stm32wl/src/bin/rtc.rs @@ -7,6 +7,7 @@ use defmt::*; use embassy_executor::Spawner; use embassy_stm32::rcc::ClockSrc; use embassy_stm32::rtc::{Rtc, RtcClockSource, RtcConfig}; +use embassy_stm32::time::Hertz; use embassy_stm32::Config; use embassy_time::{Duration, Timer}; use {defmt_rtt as _, panic_probe as _}; @@ -16,6 +17,7 @@ async fn main(_spawner: Spawner) { let p = { let mut config = Config::default(); config.rcc.mux = ClockSrc::HSE32; + config.rcc.lse = Some(Hertz(32_768)); config.rcc.rtc_mux = RtcClockSource::LSE; embassy_stm32::init(config) };