From a020b1a404c8e72d7b5404c595e57d8c04ac8701 Mon Sep 17 00:00:00 2001 From: huntc Date: Sun, 17 Oct 2021 06:28:19 +1100 Subject: [PATCH] Combine intenset calls --- embassy-nrf/src/saadc.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index 3acfa50d..273eff79 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs @@ -295,9 +295,12 @@ impl<'d, const N: usize> Saadc<'d, N> { // Reset and enable the events r.events_end.reset(); - r.intenset.write(|w| w.end().set()); r.events_started.reset(); - r.intenset.write(|w| w.started().set()); + r.intenset.write(|w| { + w.end().set(); + w.started().set(); + w + }); // Don't reorder the ADC start event before the previous writes. Hopefully self // wouldn't happen anyway.