Remove Pin from GPIO traits

This commit is contained in:
Dario Nieuwenhuis
2021-04-14 16:25:54 +02:00
parent 59ccc45f28
commit 8b1ffb2cb7
5 changed files with 27 additions and 38 deletions

View File

@ -26,13 +26,12 @@ async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) {
let button = gpioa.pa0.into_pull_up_input();
let mut syscfg = dp.SYSCFG.constrain();
let pin = ExtiPin::new(button, interrupt::take!(EXTI0), &mut syscfg);
pin_mut!(pin);
let mut pin = ExtiPin::new(button, interrupt::take!(EXTI0), &mut syscfg);
info!("Starting loop");
loop {
pin.as_mut().wait_for_rising_edge().await;
pin.wait_for_rising_edge().await;
info!("edge detected!");
}
}