stm32f4: exti: clear interrupt pending bit

bit should be cleared when created
This commit is contained in:
xoviat 2021-02-24 09:36:49 -06:00
parent 67c03e1a38
commit 582fe34dcc

View File

@ -60,9 +60,9 @@ impl<T: HalExtiPin + 'static, I: OwnedInterrupt + 'static> WaitForRisingEdge for
fn wait_for_rising_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> { fn wait_for_rising_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> {
let s = unsafe { self.get_unchecked_mut() }; let s = unsafe { self.get_unchecked_mut() };
s.pin.clear_interrupt_pending_bit();
async move { async move {
let fut = InterruptFuture::new(&mut s.interrupt); let fut = InterruptFuture::new(&mut s.interrupt);
s.pin.clear_interrupt_pending_bit();
let mut exti: EXTI = unsafe { mem::transmute(()) }; let mut exti: EXTI = unsafe { mem::transmute(()) };
s.pin.trigger_on_edge(&mut exti, Edge::RISING); s.pin.trigger_on_edge(&mut exti, Edge::RISING);
@ -80,9 +80,9 @@ impl<T: HalExtiPin + 'static, I: OwnedInterrupt + 'static> WaitForFallingEdge fo
fn wait_for_falling_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> { fn wait_for_falling_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> {
let s = unsafe { self.get_unchecked_mut() }; let s = unsafe { self.get_unchecked_mut() };
s.pin.clear_interrupt_pending_bit();
async move { async move {
let fut = InterruptFuture::new(&mut s.interrupt); let fut = InterruptFuture::new(&mut s.interrupt);
s.pin.clear_interrupt_pending_bit();
let mut exti: EXTI = unsafe { mem::transmute(()) }; let mut exti: EXTI = unsafe { mem::transmute(()) };
s.pin.trigger_on_edge(&mut exti, Edge::FALLING); s.pin.trigger_on_edge(&mut exti, Edge::FALLING);