Merge #435
435: Optimises the buffer passing for nRF SAADC r=huntc a=huntc 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. Co-authored-by: huntc <huntchr@gmail.com>
This commit is contained in:
commit
b22c472af3
@ -320,9 +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])
|
||||
== SamplerState::Sampled
|
||||
{
|
||||
if sampler(&bufs[current_buffer]) == SamplerState::Sampled {
|
||||
let next_buffer = 1 - current_buffer;
|
||||
current_buffer = next_buffer;
|
||||
r.tasks_start.write(|w| unsafe { w.bits(1) });
|
||||
|
Loading…
Reference in New Issue
Block a user