aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f0/src/bin
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-03-26 16:01:37 +0100
committerDario Nieuwenhuis <[email protected]>2025-03-27 15:18:06 +0100
commitd41eeeae79388f219bf6a84e2f7bde9f6b532516 (patch)
tree678b6fc732216e529dc38e6f65b72a309917ac32 /examples/stm32f0/src/bin
parent9edf5b7f049f95742b60b041e4443967d8a6b708 (diff)
Remove Peripheral trait, rename PeripheralRef->Peri.
Diffstat (limited to 'examples/stm32f0/src/bin')
-rw-r--r--examples/stm32f0/src/bin/button_controlled_blink.rs7
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};
8use defmt::info; 8use defmt::info;
9use embassy_executor::Spawner; 9use embassy_executor::Spawner;
10use embassy_stm32::exti::ExtiInput; 10use embassy_stm32::exti::ExtiInput;
11use embassy_stm32::gpio::{AnyPin, Level, Output, Pin, Pull, Speed}; 11use embassy_stm32::gpio::{AnyPin, Level, Output, Pull, Speed};
12use embassy_stm32::Peri;
12use embassy_time::Timer; 13use embassy_time::Timer;
13use {defmt_rtt as _, panic_probe as _}; 14use {defmt_rtt as _, panic_probe as _};
14 15
15static BLINK_MS: AtomicU32 = AtomicU32::new(0); 16static BLINK_MS: AtomicU32 = AtomicU32::new(0);
16 17
17#[embassy_executor::task] 18#[embassy_executor::task]
18async fn led_task(led: AnyPin) { 19async 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