diff options
| author | pennae <[email protected]> | 2023-05-03 11:21:58 +0200 |
|---|---|---|
| committer | pennae <[email protected]> | 2023-05-03 11:25:32 +0200 |
| commit | 17e78175a69dc96ea8f71c41949cbc705d82b51a (patch) | |
| tree | 3f239d57170508d55c16f26c9ddc9f9352cfaa0a | |
| parent | 62841dd5b958fa2458aceb638a17d243e72d987f (diff) | |
rp/pio: disable state machines on drop
| -rw-r--r-- | embassy-rp/src/pio.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/embassy-rp/src/pio.rs b/embassy-rp/src/pio.rs index 32e9be74d..d05eef04b 100644 --- a/embassy-rp/src/pio.rs +++ b/embassy-rp/src/pio.rs | |||
| @@ -324,6 +324,9 @@ pub struct PioStateMachineInstance<'d, PIO: PioInstance, const SM: usize> { | |||
| 324 | 324 | ||
| 325 | impl<'d, PIO: PioInstance, const SM: usize> Drop for PioStateMachineInstance<'d, PIO, SM> { | 325 | impl<'d, PIO: PioInstance, const SM: usize> Drop for PioStateMachineInstance<'d, PIO, SM> { |
| 326 | fn drop(&mut self) { | 326 | fn drop(&mut self) { |
| 327 | unsafe { | ||
| 328 | PIO::PIO.ctrl().write_clear(|w| w.set_sm_enable(1 << SM)); | ||
| 329 | } | ||
| 327 | on_pio_drop::<PIO>(); | 330 | on_pio_drop::<PIO>(); |
| 328 | } | 331 | } |
| 329 | } | 332 | } |
