aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin/rtc.rs
diff options
context:
space:
mode:
authorAdam Greig <[email protected]>2023-10-15 00:57:25 +0100
committerAdam Greig <[email protected]>2023-10-15 01:30:12 +0100
commit0621e957a0ddc7010d46b3ea3ddc8b9852bc8333 (patch)
treef6caefe939109e55a73e9141c736d2f6c20f51e8 /examples/stm32h7/src/bin/rtc.rs
parent7559f9e5834799b041d899767ef4305dcfdf0181 (diff)
time: Update examples, tests, and other code to use new Timer::after_x convenience methods
Diffstat (limited to 'examples/stm32h7/src/bin/rtc.rs')
-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 f2a19af81..78cea9c89 100644
--- a/examples/stm32h7/src/bin/rtc.rs
+++ b/examples/stm32h7/src/bin/rtc.rs
@@ -8,7 +8,7 @@ use embassy_executor::Spawner;
8use embassy_stm32::rcc::LsConfig; 8use embassy_stm32::rcc::LsConfig;
9use embassy_stm32::rtc::{Rtc, RtcConfig}; 9use embassy_stm32::rtc::{Rtc, RtcConfig};
10use embassy_stm32::Config; 10use embassy_stm32::Config;
11use embassy_time::{Duration, Timer}; 11use embassy_time::Timer;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14#[embassy_executor::main] 14#[embassy_executor::main]
@@ -30,7 +30,7 @@ async fn main(_spawner: Spawner) {
30 rtc.set_datetime(now.into()).expect("datetime not set"); 30 rtc.set_datetime(now.into()).expect("datetime not set");
31 31
32 // In reality the delay would be much longer 32 // In reality the delay would be much longer
33 Timer::after(Duration::from_millis(20000)).await; 33 Timer::after_millis(20000).await;
34 34
35 let then: NaiveDateTime = rtc.now().unwrap().into(); 35 let then: NaiveDateTime = rtc.now().unwrap().into();
36 info!("Got RTC! {:?}", then.timestamp()); 36 info!("Got RTC! {:?}", then.timestamp());