aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatherine <[email protected]>2023-06-19 09:06:41 +0000
committerCatherine <[email protected]>2023-06-19 09:06:41 +0000
commitbbc81146ecb3832e9ec1531ef6d48fec6c7c0d8c (patch)
tree0ffca01a5892c69e97b035129b658a0ae57c7dfa
parentec36225f8ab35fab149971e587ef506aa1c9d1ca (diff)
BDMA: request stop after busy loop in blocking_wait().
Otherwise the channel cannot be used again, since CR.EN remains set and the DMA channel registers are read-only while it is set.
-rw-r--r--embassy-stm32/src/dma/bdma.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/embassy-stm32/src/dma/bdma.rs b/embassy-stm32/src/dma/bdma.rs
index c0a503e25..e9b75d863 100644
--- a/embassy-stm32/src/dma/bdma.rs
+++ b/embassy-stm32/src/dma/bdma.rs
@@ -327,6 +327,7 @@ impl<'a, C: Channel> Transfer<'a, C> {
327 327
328 pub fn blocking_wait(mut self) { 328 pub fn blocking_wait(mut self) {
329 while self.is_running() {} 329 while self.is_running() {}
330 self.request_stop();
330 331
331 // "Subsequent reads and writes cannot be moved ahead of preceding reads." 332 // "Subsequent reads and writes cannot be moved ahead of preceding reads."
332 fence(Ordering::SeqCst); 333 fence(Ordering::SeqCst);