Compact expression
This commit is contained in:
parent
e37a10ae99
commit
b6cacb98db
@ -271,20 +271,16 @@ impl<'d, const N: usize> Saadc<'d, N> {
|
|||||||
// Establish mode and sample rate
|
// Establish mode and sample rate
|
||||||
match mode {
|
match mode {
|
||||||
Mode::Timers(sample_rate) => {
|
Mode::Timers(sample_rate) => {
|
||||||
r.samplerate.write(|w| {
|
r.samplerate.write(|w| unsafe {
|
||||||
unsafe {
|
w.cc().bits(sample_rate);
|
||||||
w.cc().bits(sample_rate);
|
w.mode().timers();
|
||||||
w.mode().timers();
|
|
||||||
}
|
|
||||||
w
|
w
|
||||||
});
|
});
|
||||||
r.tasks_sample.write(|w| unsafe { w.bits(1) }); // Need to kick-start the internal timer
|
r.tasks_sample.write(|w| unsafe { w.bits(1) }); // Need to kick-start the internal timer
|
||||||
}
|
}
|
||||||
Mode::Task => r.samplerate.write(|w| {
|
Mode::Task => r.samplerate.write(|w| unsafe {
|
||||||
unsafe {
|
w.cc().bits(0);
|
||||||
w.cc().bits(0);
|
w.mode().task();
|
||||||
w.mode().task();
|
|
||||||
}
|
|
||||||
w
|
w
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user