diff options
| author | xoviat <[email protected]> | 2025-11-04 16:35:07 -0600 |
|---|---|---|
| committer | xoviat <[email protected]> | 2025-11-04 16:35:07 -0600 |
| commit | b9559c7713bc7f773cdef0df14f1158840d06d06 (patch) | |
| tree | d5e126d6c2d891bb47375925353e155177954699 /examples/stm32g0/src/bin | |
| parent | d23c027dd1a1c5f7cdf818750dddf6a250658423 (diff) | |
rtc: use consistent api between stop and non-stop
Diffstat (limited to 'examples/stm32g0/src/bin')
| -rw-r--r-- | examples/stm32g0/src/bin/rtc.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32g0/src/bin/rtc.rs b/examples/stm32g0/src/bin/rtc.rs index 21da204cc..d8b58de22 100644 --- a/examples/stm32g0/src/bin/rtc.rs +++ b/examples/stm32g0/src/bin/rtc.rs | |||
| @@ -17,12 +17,12 @@ async fn main(_spawner: Spawner) { | |||
| 17 | 17 | ||
| 18 | let now = DateTime::from(2023, 6, 14, DayOfWeek::Friday, 15, 59, 10, 0); | 18 | let now = DateTime::from(2023, 6, 14, DayOfWeek::Friday, 15, 59, 10, 0); |
| 19 | 19 | ||
| 20 | let mut rtc = Rtc::new(p.RTC, RtcConfig::default()); | 20 | let (mut rtc, time_provider) = Rtc::new(p.RTC, RtcConfig::default()); |
| 21 | 21 | ||
| 22 | rtc.set_datetime(now.unwrap()).expect("datetime not set"); | 22 | rtc.set_datetime(now.unwrap()).expect("datetime not set"); |
| 23 | 23 | ||
| 24 | loop { | 24 | loop { |
| 25 | let now: DateTime = rtc.now().unwrap().into(); | 25 | let now: DateTime = time_provider.now().unwrap().into(); |
| 26 | 26 | ||
| 27 | info!("{}:{}:{}", now.hour(), now.minute(), now.second()); | 27 | info!("{}:{}:{}", now.hour(), now.minute(), now.second()); |
| 28 | 28 | ||
