aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f0
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32f0')
-rw-r--r--examples/stm32f0/src/bin/button_controlled_blink.rs5
-rw-r--r--examples/stm32f0/src/bin/button_exti.rs5
2 files changed, 4 insertions, 6 deletions
diff --git a/examples/stm32f0/src/bin/button_controlled_blink.rs b/examples/stm32f0/src/bin/button_controlled_blink.rs
index 360d153c3..4465483d9 100644
--- a/examples/stm32f0/src/bin/button_controlled_blink.rs
+++ b/examples/stm32f0/src/bin/button_controlled_blink.rs
@@ -8,7 +8,7 @@ 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, Input, Level, Output, Pin, Pull, Speed}; 11use embassy_stm32::gpio::{AnyPin, Level, Output, Pin, Pull, Speed};
12use embassy_time::Timer; 12use embassy_time::Timer;
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
@@ -36,8 +36,7 @@ async fn main(spawner: Spawner) {
36 36
37 // Configure the button pin and obtain handler. 37 // Configure the button pin and obtain handler.
38 // On the Nucleo F091RC there is a button connected to pin PC13. 38 // On the Nucleo F091RC there is a button connected to pin PC13.
39 let button = Input::new(p.PC13, Pull::None); 39 let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::None);
40 let mut button = ExtiInput::new(button, p.EXTI13);
41 40
42 // Create and initialize a delay variable to manage delay loop 41 // Create and initialize a delay variable to manage delay loop
43 let mut del_var = 2000; 42 let mut del_var = 2000;
diff --git a/examples/stm32f0/src/bin/button_exti.rs b/examples/stm32f0/src/bin/button_exti.rs
index ce17c1a48..fd615a215 100644
--- a/examples/stm32f0/src/bin/button_exti.rs
+++ b/examples/stm32f0/src/bin/button_exti.rs
@@ -4,7 +4,7 @@
4use defmt::*; 4use defmt::*;
5use embassy_executor::Spawner; 5use embassy_executor::Spawner;
6use embassy_stm32::exti::ExtiInput; 6use embassy_stm32::exti::ExtiInput;
7use embassy_stm32::gpio::{Input, Pull}; 7use embassy_stm32::gpio::Pull;
8use {defmt_rtt as _, panic_probe as _}; 8use {defmt_rtt as _, panic_probe as _};
9 9
10#[embassy_executor::main] 10#[embassy_executor::main]
@@ -13,8 +13,7 @@ async fn main(_spawner: Spawner) {
13 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
14 // Configure the button pin and obtain handler. 14 // Configure the button pin and obtain handler.
15 // On the Nucleo F091RC there is a button connected to pin PC13. 15 // On the Nucleo F091RC there is a button connected to pin PC13.
16 let button = Input::new(p.PC13, Pull::Down); 16 let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::Down);
17 let mut button = ExtiInput::new(button, p.EXTI13);
18 17
19 info!("Press the USER button..."); 18 info!("Press the USER button...");
20 loop { 19 loop {