diff options
| author | Wilfried Chauveau <[email protected]> | 2021-11-21 10:19:34 +0000 |
|---|---|---|
| committer | Wilfried Chauveau <[email protected]> | 2021-11-21 10:25:43 +0000 |
| commit | d5a2462cbaa02b8a98f573a36bdcf22f6136ab1c (patch) | |
| tree | 4575eede12c271a17d1977545e086cae3279d782 | |
| parent | eac604accd27fc2a32aeb2e1b1256c4b9ef52951 (diff) | |
Update embassy-nrf with lifetime bounds on gpio implementations.
| -rw-r--r-- | embassy-nrf/src/gpiote.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs index ee638aeac..2e9a73564 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> { | |||
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | impl<'d, T: GpioPin> WaitForHigh for PortInput<'d, T> { | 340 | impl<'d, T: GpioPin> WaitForHigh for PortInput<'d, T> { |
| 341 | type Future<'a> = PortInputFuture<'a>; | 341 | type Future<'a> |
| 342 | where | ||
| 343 | Self: 'a, | ||
| 344 | = PortInputFuture<'a>; | ||
| 342 | 345 | ||
| 343 | fn wait_for_high<'a>(&'a mut self) -> Self::Future<'a> { | 346 | fn wait_for_high<'a>(&'a mut self) -> Self::Future<'a> { |
| 344 | self.pin.pin.conf().modify(|_, w| w.sense().high()); | 347 | self.pin.pin.conf().modify(|_, w| w.sense().high()); |
| @@ -351,7 +354,10 @@ impl<'d, T: GpioPin> WaitForHigh for PortInput<'d, T> { | |||
| 351 | } | 354 | } |
| 352 | 355 | ||
| 353 | impl<'d, T: GpioPin> WaitForLow for PortInput<'d, T> { | 356 | impl<'d, T: GpioPin> WaitForLow for PortInput<'d, T> { |
| 354 | type Future<'a> = PortInputFuture<'a>; | 357 | type Future<'a> |
| 358 | where | ||
| 359 | Self: 'a, | ||
| 360 | = PortInputFuture<'a>; | ||
| 355 | 361 | ||
| 356 | fn wait_for_low<'a>(&'a mut self) -> Self::Future<'a> { | 362 | fn wait_for_low<'a>(&'a mut self) -> Self::Future<'a> { |
| 357 | self.pin.pin.conf().modify(|_, w| w.sense().low()); | 363 | self.pin.pin.conf().modify(|_, w| w.sense().low()); |
| @@ -364,7 +370,11 @@ impl<'d, T: GpioPin> WaitForLow for PortInput<'d, T> { | |||
| 364 | } | 370 | } |
| 365 | 371 | ||
| 366 | impl<'d, T: GpioPin> WaitForAnyEdge for PortInput<'d, T> { | 372 | impl<'d, T: GpioPin> WaitForAnyEdge for PortInput<'d, T> { |
| 367 | type Future<'a> = PortInputFuture<'a>; | 373 | type Future<'a> |
| 374 | where | ||
| 375 | Self: 'a, | ||
| 376 | = PortInputFuture<'a>; | ||
| 377 | |||
| 368 | fn wait_for_any_edge<'a>(&'a mut self) -> Self::Future<'a> { | 378 | fn wait_for_any_edge<'a>(&'a mut self) -> Self::Future<'a> { |
| 369 | if self.is_high().ok().unwrap() { | 379 | if self.is_high().ok().unwrap() { |
| 370 | self.pin.pin.conf().modify(|_, w| w.sense().low()); | 380 | self.pin.pin.conf().modify(|_, w| w.sense().low()); |
