diff options
| author | Adam Greig <[email protected]> | 2023-10-15 00:57:25 +0100 |
|---|---|---|
| committer | Adam Greig <[email protected]> | 2023-10-15 01:30:12 +0100 |
| commit | 0621e957a0ddc7010d46b3ea3ddc8b9852bc8333 (patch) | |
| tree | f6caefe939109e55a73e9141c736d2f6c20f51e8 /examples/stm32l4/src/bin/rtc.rs | |
| parent | 7559f9e5834799b041d899767ef4305dcfdf0181 (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.rs | 4 |
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 | |||
| 9 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | 9 | use embassy_stm32::rtc::{Rtc, RtcConfig}; |
| 10 | use embassy_stm32::time::Hertz; | 10 | use embassy_stm32::time::Hertz; |
| 11 | use embassy_stm32::Config; | 11 | use embassy_stm32::Config; |
| 12 | use embassy_time::{Duration, Timer}; | 12 | use embassy_time::Timer; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {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()); |
