add dma is_running change doc

This commit is contained in:
JuliDi 2023-06-28 15:39:36 +02:00
parent bf7e24e9d7
commit daedfbbd87
No known key found for this signature in database
GPG key ID: E1E90AE563D09D63

View file

@ -404,11 +404,9 @@ impl<'a, C: Channel> Transfer<'a, C> {
} }
pub fn is_running(&mut self) -> bool { 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 ch = self.channel.regs().st(self.channel.num());
let en = ch.cr().read().en(); 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 circular = ch.cr().read().circ() == vals::Circ::ENABLED;
let tcif = STATE.complete_count[self.channel.index()].load(Ordering::Acquire) != 0; let tcif = STATE.complete_count[self.channel.index()].load(Ordering::Acquire) != 0;
en && (circular || !tcif) en && (circular || !tcif)