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:
parent
a5c11b1a80
commit
8dcc41c7f0
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue