aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Beaumont <[email protected]>2021-03-09 16:02:52 +0100
committerMichael Beaumont <[email protected]>2021-03-09 16:03:19 +0100
commit5e8156a47dd016618eadc5c288406f1e201f1b8b (patch)
tree3c9def663ea755a0ce2442087d65c6afafbce142
parent6278ecf4b0c312894821c2e4b4f5a1b6ea5688d4 (diff)
Add WaitForAnyEdge
-rw-r--r--embassy-stm32l0/src/exti.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/embassy-stm32l0/src/exti.rs b/embassy-stm32l0/src/exti.rs
index ca699a086..7958bd948 100644
--- a/embassy-stm32l0/src/exti.rs
+++ b/embassy-stm32l0/src/exti.rs
@@ -3,7 +3,7 @@ use core::mem;
3use core::pin::Pin; 3use core::pin::Pin;
4 4
5use embassy::interrupt::Interrupt; 5use embassy::interrupt::Interrupt;
6use embassy::traits::gpio::{WaitForFallingEdge, WaitForRisingEdge}; 6use embassy::traits::gpio::{WaitForAnyEdge, WaitForFallingEdge, WaitForRisingEdge};
7use embassy::util::InterruptFuture; 7use embassy::util::InterruptFuture;
8 8
9use crate::hal::{ 9use crate::hal::{
@@ -92,6 +92,16 @@ impl<T: PinWithInterrupt<Interrupt = I> + 'static, I: Interrupt + 'static> WaitF
92 } 92 }
93} 93}
94 94
95impl<T: PinWithInterrupt<Interrupt = I> + 'static, I: Interrupt + 'static> WaitForAnyEdge
96 for ExtiPin<T, I>
97{
98 type Future<'a> = impl Future<Output = ()> + 'a;
99
100 fn wait_for_any_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> {
101 self.wait_for_edge(TriggerEdge::Both)
102 }
103}
104
95mod private { 105mod private {
96 pub trait Sealed {} 106 pub trait Sealed {}
97} 107}