Merge pull request #1753 from xoviat/rtc-wb

stm32/rtc: enable in rcc mod
This commit is contained in:
xoviat
2023-08-09 01:48:11 +00:00
committed by GitHub
10 changed files with 155 additions and 97 deletions

View File

@ -33,10 +33,7 @@ async fn main(_spawner: Spawner) {
.and_hms_opt(10, 30, 15)
.unwrap();
let mut rtc = Rtc::new(
p.RTC,
RtcConfig::default().clock_config(embassy_stm32::rtc::RtcClockSource::LSE),
);
let mut rtc = Rtc::new(p.RTC, RtcConfig::default());
info!("Got RTC! {:?}", now.timestamp());
rtc.set_datetime(now.into()).expect("datetime not set");

View File

@ -27,10 +27,7 @@ async fn main(_spawner: Spawner) {
.and_hms_opt(10, 30, 15)
.unwrap();
let mut rtc = Rtc::new(
p.RTC,
RtcConfig::default().clock_config(embassy_stm32::rtc::RtcClockSource::LSE),
);
let mut rtc = Rtc::new(p.RTC, RtcConfig::default());
info!("Got RTC! {:?}", now.timestamp());
rtc.set_datetime(now.into()).expect("datetime not set");