fix extipin
This commit is contained in:
parent
81d99ff1a0
commit
1908141c86
1 changed files with 2 additions and 5 deletions
|
@ -13,22 +13,19 @@ use cortex_m_rt::entry;
|
|||
use embassy::executor::{task, Executor};
|
||||
use embassy::traits::gpio::*;
|
||||
use embassy::util::Forever;
|
||||
use embassy_stm32f4::exti;
|
||||
use embassy_stm32f4::exti::ExtiPin;
|
||||
use embassy_stm32f4::interrupt;
|
||||
use futures::pin_mut;
|
||||
use stm32f4xx_hal::prelude::*;
|
||||
use stm32f4xx_hal::stm32;
|
||||
|
||||
static EXTI: Forever<exti::ExtiManager> = Forever::new();
|
||||
|
||||
#[task]
|
||||
async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) {
|
||||
let gpioa = dp.GPIOA.split();
|
||||
|
||||
let button = gpioa.pa0.into_pull_up_input();
|
||||
|
||||
let exti = EXTI.put(exti::ExtiManager::new(dp.EXTI, dp.SYSCFG.constrain()));
|
||||
let pin = exti.new_pin(button, interrupt::take!(EXTI0));
|
||||
let pin = ExtiPin::new(button, interrupt::take!(EXTI0));
|
||||
pin_mut!(pin);
|
||||
|
||||
info!("Starting loop");
|
||||
|
|
Loading…
Reference in a new issue