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/stm32f0/src/bin/button_controlled_blink.rs | |
| parent | 7559f9e5834799b041d899767ef4305dcfdf0181 (diff) | |
time: Update examples, tests, and other code to use new Timer::after_x convenience methods
Diffstat (limited to 'examples/stm32f0/src/bin/button_controlled_blink.rs')
| -rw-r--r-- | examples/stm32f0/src/bin/button_controlled_blink.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32f0/src/bin/button_controlled_blink.rs b/examples/stm32f0/src/bin/button_controlled_blink.rs index f362c53f5..306df1752 100644 --- a/examples/stm32f0/src/bin/button_controlled_blink.rs +++ b/examples/stm32f0/src/bin/button_controlled_blink.rs | |||
| @@ -10,7 +10,7 @@ use defmt::info; | |||
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_stm32::exti::ExtiInput; | 11 | use embassy_stm32::exti::ExtiInput; |
| 12 | use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed}; | 12 | use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed}; |
| 13 | use embassy_time::{Duration, Timer}; | 13 | use embassy_time::Timer; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | static BLINK_MS: AtomicU32 = AtomicU32::new(0); | 16 | static BLINK_MS: AtomicU32 = AtomicU32::new(0); |
| @@ -24,7 +24,7 @@ async fn led_task(led: AnyPin) { | |||
| 24 | loop { | 24 | loop { |
| 25 | let del = BLINK_MS.load(Ordering::Relaxed); | 25 | let del = BLINK_MS.load(Ordering::Relaxed); |
| 26 | info!("Value of del is {}", del); | 26 | info!("Value of del is {}", del); |
| 27 | Timer::after(Duration::from_millis(del.into())).await; | 27 | Timer::after_millis(del.into()).await; |
| 28 | info!("LED toggling"); | 28 | info!("LED toggling"); |
| 29 | led.toggle(); | 29 | led.toggle(); |
| 30 | } | 30 | } |
