From 6dc0ed53ff9cac8436fdcc767ea8f174c752db6a Mon Sep 17 00:00:00 2001 From: huntc Date: Mon, 18 Oct 2021 11:42:30 +1100 Subject: [PATCH] Renamed sample rate to what it actually is --- embassy-nrf/src/saadc.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index 26e69491..97833510 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs @@ -260,7 +260,7 @@ impl<'d, const N: usize> Saadc<'d, N> { async fn run_sampler( &mut self, bufs: &mut [[[i16; N]; N0]; 2], - sample_rate: Option, + sample_rate_divisor: Option, mut sampler: S, ) where S: FnMut(&[[i16; N]]) -> SamplerState, @@ -268,7 +268,7 @@ impl<'d, const N: usize> Saadc<'d, N> { let r = Self::regs(); // Establish mode and sample rate - match sample_rate { + match sample_rate_divisor { Some(sr) => { r.samplerate.write(|w| unsafe { w.cc().bits(sr); @@ -369,12 +369,12 @@ impl<'d> Saadc<'d, 1> { pub async fn run_timer_sampler( &mut self, bufs: &mut [[[i16; 1]; N0]; 2], - sample_rate: u16, + sample_rate_divisor: u16, sampler: S, ) where S: FnMut(&[[i16; 1]]) -> SamplerState, { - self.run_sampler(bufs, Some(sample_rate), sampler).await; + self.run_sampler(bufs, Some(sample_rate_divisor), sampler).await; } }