Optimises the buffer passing for nRF SAADC
The buffer will always have been filled and we never explicitly stop the task outside of this code. Thus, we can assume the number of bytes in the slice.
This commit is contained in:
@ -320,7 +320,7 @@ impl<'d, const N: usize> Saadc<'d, N> {
|
||||
r.events_end.reset();
|
||||
r.intenset.write(|w| w.end().set());
|
||||
|
||||
if sampler(&bufs[current_buffer][0..r.result.amount.read().bits() as usize / N])
|
||||
if sampler(&bufs[current_buffer])
|
||||
== SamplerState::Sampled
|
||||
{
|
||||
let next_buffer = 1 - current_buffer;
|
||||
|
Reference in New Issue
Block a user