From daedfbbd8756e921cc6343ad531401d309966eaa Mon Sep 17 00:00:00 2001 From: JuliDi <20155974+JuliDi@users.noreply.github.com> Date: Wed, 28 Jun 2023 15:39:36 +0200 Subject: [PATCH] add dma is_running change doc --- embassy-stm32/src/dma/dma.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/embassy-stm32/src/dma/dma.rs b/embassy-stm32/src/dma/dma.rs index 0b7b6078..9c03599e 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> { } pub fn is_running(&mut self) -> bool { - //let ch = self.channel.regs().st(self.channel.num()); - //ch.cr().read().en() - let ch = self.channel.regs().st(self.channel.num()); let en = ch.cr().read().en(); + // Check if circular mode is enabled, if so it will still be running even if tcif == 1 let circular = ch.cr().read().circ() == vals::Circ::ENABLED; let tcif = STATE.complete_count[self.channel.index()].load(Ordering::Acquire) != 0; en && (circular || !tcif)