Merge pull request #1972 from embassy-rs/rtc-lse-fix

stm32/rtc: enable lse in examples.
This commit is contained in:
Dario Nieuwenhuis 2023-09-29 22:23:42 +00:00 committed by GitHub
commit 95b3d9eb3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -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)
};

View File

@ -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)
};