diff options
Diffstat (limited to 'examples/stm32f3/src/bin/button_events.rs')
| -rw-r--r-- | examples/stm32f3/src/bin/button_events.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs index ef5110316..404946f2a 100644 --- a/examples/stm32f3/src/bin/button_events.rs +++ b/examples/stm32f3/src/bin/button_events.rs | |||
| @@ -16,7 +16,6 @@ use embassy_executor::time::{with_timeout, Duration, Timer}; | |||
| 16 | use embassy_stm32::exti::ExtiInput; | 16 | use embassy_stm32::exti::ExtiInput; |
| 17 | use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed}; | 17 | use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed}; |
| 18 | use embassy_stm32::peripherals::PA0; | 18 | use embassy_stm32::peripherals::PA0; |
| 19 | use embassy_stm32::Peripherals; | ||
| 20 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | 19 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; |
| 21 | use embassy_util::channel::mpmc::Channel; | 20 | use embassy_util::channel::mpmc::Channel; |
| 22 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -100,7 +99,8 @@ enum ButtonEvent { | |||
| 100 | static CHANNEL: Channel<ThreadModeRawMutex, ButtonEvent, 4> = Channel::new(); | 99 | static CHANNEL: Channel<ThreadModeRawMutex, ButtonEvent, 4> = Channel::new(); |
| 101 | 100 | ||
| 102 | #[embassy_executor::main] | 101 | #[embassy_executor::main] |
| 103 | async fn main(spawner: Spawner, p: Peripherals) { | 102 | async fn main(spawner: Spawner) { |
| 103 | let p = embassy_stm32::init(Default::default()); | ||
| 104 | let button = Input::new(p.PA0, Pull::Down); | 104 | let button = Input::new(p.PA0, Pull::Down); |
| 105 | let button = ExtiInput::new(button, p.EXTI0); | 105 | let button = ExtiInput::new(button, p.EXTI0); |
| 106 | info!("Press the USER button..."); | 106 | info!("Press the USER button..."); |
