diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-03-26 16:01:37 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-03-27 15:18:06 +0100 |
| commit | d41eeeae79388f219bf6a84e2f7bde9f6b532516 (patch) | |
| tree | 678b6fc732216e529dc38e6f65b72a309917ac32 /examples/stm32f0 | |
| parent | 9edf5b7f049f95742b60b041e4443967d8a6b708 (diff) | |
Remove Peripheral trait, rename PeripheralRef->Peri.
Diffstat (limited to 'examples/stm32f0')
| -rw-r--r-- | examples/stm32f0/src/bin/button_controlled_blink.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/stm32f0/src/bin/button_controlled_blink.rs b/examples/stm32f0/src/bin/button_controlled_blink.rs index 4465483d9..744df3e3b 100644 --- a/examples/stm32f0/src/bin/button_controlled_blink.rs +++ b/examples/stm32f0/src/bin/button_controlled_blink.rs | |||
| @@ -8,14 +8,15 @@ use core::sync::atomic::{AtomicU32, Ordering}; | |||
| 8 | use defmt::info; | 8 | use defmt::info; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::exti::ExtiInput; |
| 11 | use embassy_stm32::gpio::{AnyPin, Level, Output, Pin, Pull, Speed}; | 11 | use embassy_stm32::gpio::{AnyPin, Level, Output, Pull, Speed}; |
| 12 | use embassy_stm32::Peri; | ||
| 12 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 15 | ||
| 15 | static BLINK_MS: AtomicU32 = AtomicU32::new(0); | 16 | static BLINK_MS: AtomicU32 = AtomicU32::new(0); |
| 16 | 17 | ||
| 17 | #[embassy_executor::task] | 18 | #[embassy_executor::task] |
| 18 | async fn led_task(led: AnyPin) { | 19 | async fn led_task(led: Peri<'static, AnyPin>) { |
| 19 | // Configure the LED pin as a push pull output and obtain handler. | 20 | // Configure the LED pin as a push pull output and obtain handler. |
| 20 | // On the Nucleo F091RC there's an on-board LED connected to pin PA5. | 21 | // On the Nucleo F091RC there's an on-board LED connected to pin PA5. |
| 21 | let mut led = Output::new(led, Level::Low, Speed::Low); | 22 | let mut led = Output::new(led, Level::Low, Speed::Low); |
| @@ -45,7 +46,7 @@ async fn main(spawner: Spawner) { | |||
| 45 | BLINK_MS.store(del_var, Ordering::Relaxed); | 46 | BLINK_MS.store(del_var, Ordering::Relaxed); |
| 46 | 47 | ||
| 47 | // Spawn LED blinking task | 48 | // Spawn LED blinking task |
| 48 | spawner.spawn(led_task(p.PA5.degrade())).unwrap(); | 49 | spawner.spawn(led_task(p.PA5.into())).unwrap(); |
| 49 | 50 | ||
| 50 | loop { | 51 | loop { |
| 51 | // Check if button got pressed | 52 | // Check if button got pressed |
