aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-stm32/src/dma/gpdma.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/embassy-stm32/src/dma/gpdma.rs b/embassy-stm32/src/dma/gpdma.rs
index b811da1fb..b061415eb 100644
--- a/embassy-stm32/src/dma/gpdma.rs
+++ b/embassy-stm32/src/dma/gpdma.rs
@@ -299,19 +299,15 @@ impl<'a, C: Channel> Transfer<'a, C> {
299 299
300 pub fn request_stop(&mut self) { 300 pub fn request_stop(&mut self) {
301 let ch = self.channel.regs().ch(self.channel.num()); 301 let ch = self.channel.regs().ch(self.channel.num());
302 302 ch.cr().modify(|w| {
303 // Disable the channel. Keep the IEs enabled so the irqs still fire. 303 w.set_susp(true);
304 ch.cr().write(|w| {
305 w.set_tcie(true);
306 w.set_useie(true);
307 w.set_dteie(true);
308 w.set_suspie(true);
309 }) 304 })
310 } 305 }
311 306
312 pub fn is_running(&mut self) -> bool { 307 pub fn is_running(&mut self) -> bool {
313 let ch = self.channel.regs().ch(self.channel.num()); 308 let ch = self.channel.regs().ch(self.channel.num());
314 !ch.sr().read().tcf() 309 let sr = ch.sr().read();
310 !sr.tcf() && !sr.suspf()
315 } 311 }
316 312
317 /// Gets the total remaining transfers for the channel 313 /// Gets the total remaining transfers for the channel