diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-02-24 19:17:35 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-24 19:17:35 +0100 |
| commit | d4a97ac3ed79272fbded607c5f7dc1d745fc2b66 (patch) | |
| tree | 9e2454ab50f139e89c56d5a4851839c237539dd2 | |
| parent | 465ca9086d9680d2788d3d98c1c6a8c55a27f073 (diff) | |
| parent | 582fe34dcc72085efaf483e344f1daff517018b9 (diff) | |
Merge pull request #54 from xoviat/fix-exti
stm32f4: exti: clear interrupt pending bit
| -rw-r--r-- | embassy-stm32f4/src/exti.rs | 4 |
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); |
