diff options
| author | xoviat <[email protected]> | 2025-12-05 15:42:43 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-05 15:42:43 +0000 |
| commit | a382238225ea55ee478bbde9ddb7d0d37cf004b5 (patch) | |
| tree | c9e3d872c1c7cb04a1879ba6a1f1116ee14a5d24 /embassy-stm32/src | |
| parent | 4053e5233fab875c4607cd2fed7a7cf5659ce3e1 (diff) | |
| parent | 40d00d1208c1d0ea2c9a29ea30412b0491fd0543 (diff) | |
Merge pull request #4981 from Dectron-AB/restart-dma-transfer
GPDMA suspend channel before reset if already enabled
Diffstat (limited to 'embassy-stm32/src')
| -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 |
