Add WaitForAnyEdge
This commit is contained in:
parent
6278ecf4b0
commit
5e8156a47d
@ -3,7 +3,7 @@ use core::mem;
|
|||||||
use core::pin::Pin;
|
use core::pin::Pin;
|
||||||
|
|
||||||
use embassy::interrupt::Interrupt;
|
use embassy::interrupt::Interrupt;
|
||||||
use embassy::traits::gpio::{WaitForFallingEdge, WaitForRisingEdge};
|
use embassy::traits::gpio::{WaitForAnyEdge, WaitForFallingEdge, WaitForRisingEdge};
|
||||||
use embassy::util::InterruptFuture;
|
use embassy::util::InterruptFuture;
|
||||||
|
|
||||||
use crate::hal::{
|
use crate::hal::{
|
||||||
@ -92,6 +92,16 @@ impl<T: PinWithInterrupt<Interrupt = I> + 'static, I: Interrupt + 'static> WaitF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T: PinWithInterrupt<Interrupt = I> + 'static, I: Interrupt + 'static> WaitForAnyEdge
|
||||||
|
for ExtiPin<T, I>
|
||||||
|
{
|
||||||
|
type Future<'a> = impl Future<Output = ()> + 'a;
|
||||||
|
|
||||||
|
fn wait_for_any_edge<'a>(self: Pin<&'a mut Self>) -> Self::Future<'a> {
|
||||||
|
self.wait_for_edge(TriggerEdge::Both)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mod private {
|
mod private {
|
||||||
pub trait Sealed {}
|
pub trait Sealed {}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user