stm32/dma: fix spurious transfer complete interrupts
DMA interrupts must be acknowledged by writing to the DMA_{L,H}IFCR register. Writing to the CR register is unnecessary as the channel (EN bit) is disabled by hardware on completion of the transfer.
This commit is contained in:
parent
d159a6c62d
commit
4e884ee2d2
@ -411,12 +411,8 @@ mod low_level_api {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if isr.tcif(channel_num % 4) && cr.read().tcie() {
|
if isr.tcif(channel_num % 4) && cr.read().tcie() {
|
||||||
if cr.read().dbm() == vals::Dbm::DISABLED {
|
/* acknowledge transfer complete interrupt */
|
||||||
cr.write(|_| ()); // Disable channel with the default value.
|
|
||||||
} else {
|
|
||||||
// for double buffered mode, clear TCIF flag but do not stop the transfer
|
|
||||||
dma.ifcr(channel_num / 4).write(|w| w.set_tcif(channel_num % 4, true));
|
dma.ifcr(channel_num / 4).write(|w| w.set_tcif(channel_num % 4, true));
|
||||||
}
|
|
||||||
STATE.channels[state_index].waker.wake();
|
STATE.channels[state_index].waker.wake();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user