diff options
| author | huntc <[email protected]> | 2021-10-17 06:28:19 +1100 |
|---|---|---|
| committer | huntc <[email protected]> | 2021-10-18 10:26:11 +1100 |
| commit | a020b1a404c8e72d7b5404c595e57d8c04ac8701 (patch) | |
| tree | 5bc29a4bf4a95bc142665644a09f1aae1ea9e28a | |
| parent | b6cacb98db9148013fbabc124a2d8e296232b2e0 (diff) | |
Combine intenset calls
| -rw-r--r-- | embassy-nrf/src/saadc.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index 3acfa50d7..273eff799 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs | |||
| @@ -295,9 +295,12 @@ impl<'d, const N: usize> Saadc<'d, N> { | |||
| 295 | 295 | ||
| 296 | // Reset and enable the events | 296 | // Reset and enable the events |
| 297 | r.events_end.reset(); | 297 | r.events_end.reset(); |
| 298 | r.intenset.write(|w| w.end().set()); | ||
| 299 | r.events_started.reset(); | 298 | r.events_started.reset(); |
| 300 | r.intenset.write(|w| w.started().set()); | 299 | r.intenset.write(|w| { |
| 300 | w.end().set(); | ||
| 301 | w.started().set(); | ||
| 302 | w | ||
| 303 | }); | ||
| 301 | 304 | ||
| 302 | // Don't reorder the ADC start event before the previous writes. Hopefully self | 305 | // Don't reorder the ADC start event before the previous writes. Hopefully self |
| 303 | // wouldn't happen anyway. | 306 | // wouldn't happen anyway. |
