From d5a2462cbaa02b8a98f573a36bdcf22f6136ab1c Mon Sep 17 00:00:00 2001 From: Wilfried Chauveau Date: Sun, 21 Nov 2021 10:19:34 +0000 Subject: [PATCH] Update embassy-nrf with lifetime bounds on gpio implementations. --- embassy-nrf/src/gpiote.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs index ee638aea..2e9a7356 100644 --- a/embassy-nrf/src/gpiote.rs +++ b/embassy-nrf/src/gpiote.rs @@ -338,7 +338,10 @@ impl<'d, T: GpioPin> InputPin for PortInput<'d, T> { } impl<'d, T: GpioPin> WaitForHigh for PortInput<'d, T> { - type Future<'a> = PortInputFuture<'a>; + type Future<'a> + where + Self: 'a, + = PortInputFuture<'a>; fn wait_for_high<'a>(&'a mut self) -> Self::Future<'a> { self.pin.pin.conf().modify(|_, w| w.sense().high()); @@ -351,7 +354,10 @@ impl<'d, T: GpioPin> WaitForHigh for PortInput<'d, T> { } impl<'d, T: GpioPin> WaitForLow for PortInput<'d, T> { - type Future<'a> = PortInputFuture<'a>; + type Future<'a> + where + Self: 'a, + = PortInputFuture<'a>; fn wait_for_low<'a>(&'a mut self) -> Self::Future<'a> { self.pin.pin.conf().modify(|_, w| w.sense().low()); @@ -364,7 +370,11 @@ impl<'d, T: GpioPin> WaitForLow for PortInput<'d, T> { } impl<'d, T: GpioPin> WaitForAnyEdge for PortInput<'d, T> { - type Future<'a> = PortInputFuture<'a>; + type Future<'a> + where + Self: 'a, + = PortInputFuture<'a>; + fn wait_for_any_edge<'a>(&'a mut self) -> Self::Future<'a> { if self.is_high().ok().unwrap() { self.pin.pin.conf().modify(|_, w| w.sense().low());