From 81cbb0fc322c8dd23128a28e0500df1f185e1067 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 30 Jun 2023 11:47:20 +0200 Subject: [PATCH] Attempt to fix certain borrowing rule issues --- embassy-nrf/src/buffered_uarte.rs | 4 +++- embassy-nrf/src/saadc.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index 9bc1c1e7..c1300d7e 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs @@ -352,11 +352,13 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> { s.rx_ppi_ch.store(ppi_ch2.number() as u8, Ordering::Relaxed); let mut ppi_group = PpiGroup::new(ppi_group); + let ppi_group_channel_disable_all_task = ppi_group.task_disable_all(); + let mut ppi_ch2 = Ppi::new_one_to_two( ppi_ch2, Event::from_reg(&r.events_endrx), Task::from_reg(&r.tasks_startrx), - ppi_group.task_disable_all(), + ppi_group_channel_disable_all_task ); ppi_ch2.disable(); ppi_group.add_channel(&ppi_ch2); diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index cf3fb999..b6984b0f 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs @@ -320,7 +320,9 @@ impl<'d, const N: usize> Saadc<'d, N> { timer.cc(0).write(sample_counter); timer.cc(0).short_compare_clear(); - let mut sample_ppi = Ppi::new_one_to_one(ppi_ch2, timer.cc(0).event_compare(), Task::from_reg(&r.tasks_sample)); + let compare_event = timer.cc(0).event_compare(); + + let mut sample_ppi = Ppi::new_one_to_one(ppi_ch2, compare_event, Task::from_reg(&r.tasks_sample)); timer.start();