From b9559c7713bc7f773cdef0df14f1158840d06d06 Mon Sep 17 00:00:00 2001 From: xoviat Date: Tue, 4 Nov 2025 16:35:07 -0600 Subject: rtc: use consistent api between stop and non-stop --- examples/stm32wl/src/bin/rtc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/stm32wl/src') diff --git a/examples/stm32wl/src/bin/rtc.rs b/examples/stm32wl/src/bin/rtc.rs index d3709120f..2185142c9 100644 --- a/examples/stm32wl/src/bin/rtc.rs +++ b/examples/stm32wl/src/bin/rtc.rs @@ -44,7 +44,7 @@ async fn main(_spawner: Spawner) { .and_hms_opt(10, 30, 15) .unwrap(); - let mut rtc = Rtc::new(p.RTC, RtcConfig::default()); + let (mut rtc, time_provider) = Rtc::new(p.RTC, RtcConfig::default()); info!("Got RTC! {:?}", now.and_utc().timestamp()); rtc.set_datetime(now.into()).expect("datetime not set"); @@ -52,6 +52,6 @@ async fn main(_spawner: Spawner) { // In reality the delay would be much longer Timer::after_millis(20000).await; - let then: NaiveDateTime = rtc.now().unwrap().into(); + let then: NaiveDateTime = time_provider.now().unwrap().into(); info!("Got RTC! {:?}", then.and_utc().timestamp()); } -- cgit