From 582fe34dcc72085efaf483e344f1daff517018b9 Mon Sep 17 00:00:00 2001 From: xoviat Date: Wed, 24 Feb 2021 09:36:49 -0600 Subject: [PATCH] stm32f4: exti: clear interrupt pending bit bit should be cleared when created --- embassy-stm32f4/src/exti.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/embassy-stm32f4/src/exti.rs b/embassy-stm32f4/src/exti.rs index bf9cc582..5782b8eb 100644 --- a/embassy-stm32f4/src/exti.rs +++ b/embassy-stm32f4/src/exti.rs @@ -60,9 +60,9 @@ impl WaitForRisingEdge for fn wait_for_rising_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> { let s = unsafe { self.get_unchecked_mut() }; + s.pin.clear_interrupt_pending_bit(); async move { let fut = InterruptFuture::new(&mut s.interrupt); - s.pin.clear_interrupt_pending_bit(); let mut exti: EXTI = unsafe { mem::transmute(()) }; s.pin.trigger_on_edge(&mut exti, Edge::RISING); @@ -80,9 +80,9 @@ impl WaitForFallingEdge fo fn wait_for_falling_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> { let s = unsafe { self.get_unchecked_mut() }; + s.pin.clear_interrupt_pending_bit(); async move { let fut = InterruptFuture::new(&mut s.interrupt); - s.pin.clear_interrupt_pending_bit(); let mut exti: EXTI = unsafe { mem::transmute(()) }; s.pin.trigger_on_edge(&mut exti, Edge::FALLING);