Merge pull request #2180 from MaxiluxSystems/gpdma-drop-fix
stm32/gpdma: fix drop() to use documented method for aborting transfer
This commit is contained in:
commit
ea99671729
@ -299,19 +299,15 @@ impl<'a, C: Channel> Transfer<'a, C> {
|
|||||||
|
|
||||||
pub fn request_stop(&mut self) {
|
pub fn request_stop(&mut self) {
|
||||||
let ch = self.channel.regs().ch(self.channel.num());
|
let ch = self.channel.regs().ch(self.channel.num());
|
||||||
|
ch.cr().modify(|w| {
|
||||||
// Disable the channel. Keep the IEs enabled so the irqs still fire.
|
w.set_susp(true);
|
||||||
ch.cr().write(|w| {
|
|
||||||
w.set_tcie(true);
|
|
||||||
w.set_useie(true);
|
|
||||||
w.set_dteie(true);
|
|
||||||
w.set_suspie(true);
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_running(&mut self) -> bool {
|
pub fn is_running(&mut self) -> bool {
|
||||||
let ch = self.channel.regs().ch(self.channel.num());
|
let ch = self.channel.regs().ch(self.channel.num());
|
||||||
!ch.sr().read().tcf()
|
let sr = ch.sr().read();
|
||||||
|
!sr.tcf() && !sr.suspf()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the total remaining transfers for the channel
|
/// Gets the total remaining transfers for the channel
|
||||||
|
Loading…
Reference in New Issue
Block a user