fix borrow checker
This commit is contained in:
parent
3d103acdde
commit
ccf2ea77f0
1 changed files with 6 additions and 4 deletions
|
@ -99,11 +99,12 @@ impl<T: gpio::ExtiPin + WithInterrupt + 'static> WaitForRisingEdge for ExtiPin<T
|
||||||
s.pin.clear_interrupt_pending_bit();
|
s.pin.clear_interrupt_pending_bit();
|
||||||
async move {
|
async move {
|
||||||
let fut = InterruptFuture::new(&mut s.interrupt);
|
let fut = InterruptFuture::new(&mut s.interrupt);
|
||||||
|
let pin = &mut s.pin;
|
||||||
cortex_m::interrupt::free(|_| {
|
cortex_m::interrupt::free(|_| {
|
||||||
let mut exti: EXTI = unsafe { mem::transmute(()) };
|
let mut exti: EXTI = unsafe { mem::transmute(()) };
|
||||||
|
|
||||||
s.pin.trigger_on_edge(&mut exti, Edge::RISING);
|
pin.trigger_on_edge(&mut exti, Edge::RISING);
|
||||||
s.pin.enable_interrupt(&mut exti);
|
pin.enable_interrupt(&mut exti);
|
||||||
});
|
});
|
||||||
fut.await;
|
fut.await;
|
||||||
|
|
||||||
|
@ -121,11 +122,12 @@ impl<T: gpio::ExtiPin + WithInterrupt + 'static> WaitForFallingEdge for ExtiPin<
|
||||||
s.pin.clear_interrupt_pending_bit();
|
s.pin.clear_interrupt_pending_bit();
|
||||||
async move {
|
async move {
|
||||||
let fut = InterruptFuture::new(&mut s.interrupt);
|
let fut = InterruptFuture::new(&mut s.interrupt);
|
||||||
|
let pin = &mut s.pin;
|
||||||
cortex_m::interrupt::free(|_| {
|
cortex_m::interrupt::free(|_| {
|
||||||
let mut exti: EXTI = unsafe { mem::transmute(()) };
|
let mut exti: EXTI = unsafe { mem::transmute(()) };
|
||||||
|
|
||||||
s.pin.trigger_on_edge(&mut exti, Edge::FALLING);
|
pin.trigger_on_edge(&mut exti, Edge::FALLING);
|
||||||
s.pin.enable_interrupt(&mut exti);
|
pin.enable_interrupt(&mut exti);
|
||||||
});
|
});
|
||||||
fut.await;
|
fut.await;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue