diff options
| -rw-r--r-- | embassy-stm32/src/dma/dma.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/embassy-stm32/src/dma/dma.rs b/embassy-stm32/src/dma/dma.rs index 0b7b60789..9c03599eb 100644 --- a/embassy-stm32/src/dma/dma.rs +++ b/embassy-stm32/src/dma/dma.rs | |||
| @@ -404,11 +404,9 @@ impl<'a, C: Channel> Transfer<'a, C> { | |||
| 404 | } | 404 | } |
| 405 | 405 | ||
| 406 | pub fn is_running(&mut self) -> bool { | 406 | pub fn is_running(&mut self) -> bool { |
| 407 | //let ch = self.channel.regs().st(self.channel.num()); | ||
| 408 | //ch.cr().read().en() | ||
| 409 | |||
| 410 | let ch = self.channel.regs().st(self.channel.num()); | 407 | let ch = self.channel.regs().st(self.channel.num()); |
| 411 | let en = ch.cr().read().en(); | 408 | let en = ch.cr().read().en(); |
| 409 | // Check if circular mode is enabled, if so it will still be running even if tcif == 1 | ||
| 412 | let circular = ch.cr().read().circ() == vals::Circ::ENABLED; | 410 | let circular = ch.cr().read().circ() == vals::Circ::ENABLED; |
| 413 | let tcif = STATE.complete_count[self.channel.index()].load(Ordering::Acquire) != 0; | 411 | let tcif = STATE.complete_count[self.channel.index()].load(Ordering::Acquire) != 0; |
| 414 | en && (circular || !tcif) | 412 | en && (circular || !tcif) |
