aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32l4/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/stm32l4/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/stm32l4/src/bin/rtc.rs')
-rw-r--r--examples/stm32l4/src/bin/rtc.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32l4/src/bin/rtc.rs b/examples/stm32l4/src/bin/rtc.rs
index 33efc76b3..f5d46e95f 100644
--- a/examples/stm32l4/src/bin/rtc.rs
+++ b/examples/stm32l4/src/bin/rtc.rs
@@ -9,7 +9,7 @@ use embassy_stm32::rcc::{ClockSrc, LsConfig, PLLSource, PllMul, PllPreDiv, PllRD
9use embassy_stm32::rtc::{Rtc, RtcConfig}; 9use embassy_stm32::rtc::{Rtc, RtcConfig};
10use embassy_stm32::time::Hertz; 10use embassy_stm32::time::Hertz;
11use embassy_stm32::Config; 11use embassy_stm32::Config;
12use embassy_time::{Duration, Timer}; 12use embassy_time::Timer;
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
15#[embassy_executor::main] 15#[embassy_executor::main]
@@ -39,7 +39,7 @@ async fn main(_spawner: Spawner) {
39 rtc.set_datetime(now.into()).expect("datetime not set"); 39 rtc.set_datetime(now.into()).expect("datetime not set");
40 40
41 // In reality the delay would be much longer 41 // In reality the delay would be much longer
42 Timer::after(Duration::from_millis(20000)).await; 42 Timer::after_millis(20000).await;
43 43
44 let then: NaiveDateTime = rtc.now().unwrap().into(); 44 let then: NaiveDateTime = rtc.now().unwrap().into();
45 info!("Got RTC! {:?}", then.timestamp()); 45 info!("Got RTC! {:?}", then.timestamp());