aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-nrf/src/saadc.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs
index 26e694916..978335108 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> {
260 async fn run_sampler<S, const N0: usize>( 260 async fn run_sampler<S, const N0: usize>(
261 &mut self, 261 &mut self,
262 bufs: &mut [[[i16; N]; N0]; 2], 262 bufs: &mut [[[i16; N]; N0]; 2],
263 sample_rate: Option<u16>, 263 sample_rate_divisor: Option<u16>,
264 mut sampler: S, 264 mut sampler: S,
265 ) where 265 ) where
266 S: FnMut(&[[i16; N]]) -> SamplerState, 266 S: FnMut(&[[i16; N]]) -> SamplerState,
@@ -268,7 +268,7 @@ impl<'d, const N: usize> Saadc<'d, N> {
268 let r = Self::regs(); 268 let r = Self::regs();
269 269
270 // Establish mode and sample rate 270 // Establish mode and sample rate
271 match sample_rate { 271 match sample_rate_divisor {
272 Some(sr) => { 272 Some(sr) => {
273 r.samplerate.write(|w| unsafe { 273 r.samplerate.write(|w| unsafe {
274 w.cc().bits(sr); 274 w.cc().bits(sr);
@@ -369,12 +369,12 @@ impl<'d> Saadc<'d, 1> {
369 pub async fn run_timer_sampler<S, const N0: usize>( 369 pub async fn run_timer_sampler<S, const N0: usize>(
370 &mut self, 370 &mut self,
371 bufs: &mut [[[i16; 1]; N0]; 2], 371 bufs: &mut [[[i16; 1]; N0]; 2],
372 sample_rate: u16, 372 sample_rate_divisor: u16,
373 sampler: S, 373 sampler: S,
374 ) where 374 ) where
375 S: FnMut(&[[i16; 1]]) -> SamplerState, 375 S: FnMut(&[[i16; 1]]) -> SamplerState,
376 { 376 {
377 self.run_sampler(bufs, Some(sample_rate), sampler).await; 377 self.run_sampler(bufs, Some(sample_rate_divisor), sampler).await;
378 } 378 }
379} 379}
380 380