aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxoviat <[email protected]>2021-02-24 09:36:49 -0600
committerxoviat <[email protected]>2021-02-24 09:36:49 -0600
commit582fe34dcc72085efaf483e344f1daff517018b9 (patch)
treee7ee322d589f96fc6a9ec3d0e68a178c284bd527
parent67c03e1a383f56b1f6ca126f29cc8a806ed31a24 (diff)
stm32f4: exti: clear interrupt pending bit
bit should be cleared when created
-rw-r--r--embassy-stm32f4/src/exti.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-stm32f4/src/exti.rs b/embassy-stm32f4/src/exti.rs
index bf9cc582f..5782b8ebf 100644
--- a/embassy-stm32f4/src/exti.rs
+++ b/embassy-stm32f4/src/exti.rs
@@ -60,9 +60,9 @@ impl<T: HalExtiPin + 'static, I: OwnedInterrupt + 'static> WaitForRisingEdge for
60 fn wait_for_rising_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> { 60 fn wait_for_rising_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> {
61 let s = unsafe { self.get_unchecked_mut() }; 61 let s = unsafe { self.get_unchecked_mut() };
62 62
63 s.pin.clear_interrupt_pending_bit();
63 async move { 64 async move {
64 let fut = InterruptFuture::new(&mut s.interrupt); 65 let fut = InterruptFuture::new(&mut s.interrupt);
65 s.pin.clear_interrupt_pending_bit();
66 let mut exti: EXTI = unsafe { mem::transmute(()) }; 66 let mut exti: EXTI = unsafe { mem::transmute(()) };
67 67
68 s.pin.trigger_on_edge(&mut exti, Edge::RISING); 68 s.pin.trigger_on_edge(&mut exti, Edge::RISING);
@@ -80,9 +80,9 @@ impl<T: HalExtiPin + 'static, I: OwnedInterrupt + 'static> WaitForFallingEdge fo
80 fn wait_for_falling_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> { 80 fn wait_for_falling_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> {
81 let s = unsafe { self.get_unchecked_mut() }; 81 let s = unsafe { self.get_unchecked_mut() };
82 82
83 s.pin.clear_interrupt_pending_bit();
83 async move { 84 async move {
84 let fut = InterruptFuture::new(&mut s.interrupt); 85 let fut = InterruptFuture::new(&mut s.interrupt);
85 s.pin.clear_interrupt_pending_bit();
86 let mut exti: EXTI = unsafe { mem::transmute(()) }; 86 let mut exti: EXTI = unsafe { mem::transmute(()) };
87 87
88 s.pin.trigger_on_edge(&mut exti, Edge::FALLING); 88 s.pin.trigger_on_edge(&mut exti, Edge::FALLING);