Revert changes to dma.rs

This commit is contained in:
Julian 2023-06-29 09:20:25 +02:00 committed by GitHub
parent d5898c11eb
commit 96f1525ffe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -405,11 +405,7 @@ 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()); let ch = self.channel.regs().st(self.channel.num());
let en = ch.cr().read().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)
} }
/// Gets the total remaining transfers for the channel /// Gets the total remaining transfers for the channel