diff options
| author | Albin Hedman <[email protected]> | 2025-12-03 18:04:48 +0100 |
|---|---|---|
| committer | Albin Hedman <[email protected]> | 2025-12-03 18:06:25 +0100 |
| commit | b732336f2f3ff9f7ec27d1d75a3e78cc1a0ad054 (patch) | |
| tree | 95104bfbbd11a1238b6521d1f9a6d6c5c75a3904 /embassy-stm32/src/dma | |
| parent | 95fd1f46a2c44f961e27f48920d87468d39a3793 (diff) | |
GPDMA suspend channel before reset if already enabled
Diffstat (limited to 'embassy-stm32/src/dma')
| -rw-r--r-- | embassy-stm32/src/dma/gpdma/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/embassy-stm32/src/dma/gpdma/mod.rs b/embassy-stm32/src/dma/gpdma/mod.rs index bfd0570f8..51c107cb4 100644 --- a/embassy-stm32/src/dma/gpdma/mod.rs +++ b/embassy-stm32/src/dma/gpdma/mod.rs | |||
| @@ -238,6 +238,11 @@ impl AnyChannel { | |||
| 238 | // "Preceding reads and writes cannot be moved past subsequent writes." | 238 | // "Preceding reads and writes cannot be moved past subsequent writes." |
| 239 | fence(Ordering::SeqCst); | 239 | fence(Ordering::SeqCst); |
| 240 | 240 | ||
| 241 | if ch.cr().read().en() { | ||
| 242 | ch.cr().modify(|w| w.set_susp(true)); | ||
| 243 | while !ch.sr().read().suspf() {} | ||
| 244 | } | ||
| 245 | |||
| 241 | ch.cr().write(|w| w.set_reset(true)); | 246 | ch.cr().write(|w| w.set_reset(true)); |
| 242 | ch.fcr().write(|w| { | 247 | ch.fcr().write(|w| { |
| 243 | // Clear all irqs | 248 | // Clear all irqs |
