stm32/rtc: enable lse in examples.

This commit is contained in:
Dario Nieuwenhuis 2023-09-30 00:12:19 +02:00
parent 6627824c02
commit f1e7205055
2 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,7 @@ async fn main(_spawner: Spawner) {
PLLMul::Mul20, PLLMul::Mul20,
None, None,
); );
config.rcc.lse = Some(Hertz(32_768));
config.rcc.rtc_mux = rcc::RtcClockSource::LSE; config.rcc.rtc_mux = rcc::RtcClockSource::LSE;
embassy_stm32::init(config) embassy_stm32::init(config)
}; };

View File

@ -7,6 +7,7 @@ use defmt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_stm32::rcc::ClockSrc; use embassy_stm32::rcc::ClockSrc;
use embassy_stm32::rtc::{Rtc, RtcClockSource, RtcConfig}; use embassy_stm32::rtc::{Rtc, RtcClockSource, RtcConfig};
use embassy_stm32::time::Hertz;
use embassy_stm32::Config; use embassy_stm32::Config;
use embassy_time::{Duration, Timer}; use embassy_time::{Duration, Timer};
use {defmt_rtt as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _};
@ -16,6 +17,7 @@ async fn main(_spawner: Spawner) {
let p = { let p = {
let mut config = Config::default(); let mut config = Config::default();
config.rcc.mux = ClockSrc::HSE32; config.rcc.mux = ClockSrc::HSE32;
config.rcc.lse = Some(Hertz(32_768));
config.rcc.rtc_mux = RtcClockSource::LSE; config.rcc.rtc_mux = RtcClockSource::LSE;
embassy_stm32::init(config) embassy_stm32::init(config)
}; };