aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7
diff options
context:
space:
mode:
authorxoviat <[email protected]>2025-11-04 16:35:07 -0600
committerxoviat <[email protected]>2025-11-04 16:35:07 -0600
commitb9559c7713bc7f773cdef0df14f1158840d06d06 (patch)
treed5e126d6c2d891bb47375925353e155177954699 /examples/stm32h7
parentd23c027dd1a1c5f7cdf818750dddf6a250658423 (diff)
rtc: use consistent api between stop and non-stop
Diffstat (limited to 'examples/stm32h7')
-rw-r--r--examples/stm32h7/src/bin/rtc.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32h7/src/bin/rtc.rs b/examples/stm32h7/src/bin/rtc.rs
index 1bd71637b..965716d23 100644
--- a/examples/stm32h7/src/bin/rtc.rs
+++ b/examples/stm32h7/src/bin/rtc.rs
@@ -23,7 +23,7 @@ async fn main(_spawner: Spawner) {
23 .and_hms_opt(10, 30, 15) 23 .and_hms_opt(10, 30, 15)
24 .unwrap(); 24 .unwrap();
25 25
26 let mut rtc = Rtc::new(p.RTC, RtcConfig::default()); 26 let (mut rtc, time_provider) = Rtc::new(p.RTC, RtcConfig::default());
27 info!("Got RTC! {:?}", now.and_utc().timestamp()); 27 info!("Got RTC! {:?}", now.and_utc().timestamp());
28 28
29 rtc.set_datetime(now.into()).expect("datetime not set"); 29 rtc.set_datetime(now.into()).expect("datetime not set");
@@ -31,6 +31,6 @@ async fn main(_spawner: Spawner) {
31 // In reality the delay would be much longer 31 // In reality the delay would be much longer
32 Timer::after_millis(20000).await; 32 Timer::after_millis(20000).await;
33 33
34 let then: NaiveDateTime = rtc.now().unwrap().into(); 34 let then: NaiveDateTime = time_provider.now().unwrap().into();
35 info!("Got RTC! {:?}", then.and_utc().timestamp()); 35 info!("Got RTC! {:?}", then.and_utc().timestamp());
36} 36}