Merge #647
647: Stm32 dma error handling r=Dirbaio a=Dirbaio Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
This commit is contained in:
commit
828cdb2951
@ -238,6 +238,12 @@ mod low_level_api {
|
|||||||
let isr = dma.isr().read();
|
let isr = dma.isr().read();
|
||||||
let cr = dma.ch(channel_num).cr();
|
let cr = dma.ch(channel_num).cr();
|
||||||
|
|
||||||
|
if isr.teif(channel_num) {
|
||||||
|
panic!(
|
||||||
|
"DMA: error on BDMA@{:08x} channel {}",
|
||||||
|
dma.0 as u32, channel_num
|
||||||
|
);
|
||||||
|
}
|
||||||
if isr.tcif(channel_num) && cr.read().tcie() {
|
if isr.tcif(channel_num) && cr.read().tcie() {
|
||||||
cr.write(|_| ()); // Disable channel interrupts with the default value.
|
cr.write(|_| ()); // Disable channel interrupts with the default value.
|
||||||
STATE.ch_wakers[index].wake();
|
STATE.ch_wakers[index].wake();
|
||||||
|
@ -239,6 +239,12 @@ mod low_level_api {
|
|||||||
let cr = dma.st(channel_num).cr();
|
let cr = dma.st(channel_num).cr();
|
||||||
let isr = dma.isr(channel_num / 4).read();
|
let isr = dma.isr(channel_num / 4).read();
|
||||||
|
|
||||||
|
if isr.teif(channel_num % 4) {
|
||||||
|
panic!(
|
||||||
|
"DMA: error on DMA@{:08x} channel {}",
|
||||||
|
dma.0 as u32, channel_num
|
||||||
|
);
|
||||||
|
}
|
||||||
if isr.tcif(channel_num % 4) && cr.read().tcie() {
|
if isr.tcif(channel_num % 4) && cr.read().tcie() {
|
||||||
cr.write(|_| ()); // Disable channel interrupts with the default value.
|
cr.write(|_| ()); // Disable channel interrupts with the default value.
|
||||||
STATE.ch_wakers[index].wake();
|
STATE.ch_wakers[index].wake();
|
||||||
|
Loading…
Reference in New Issue
Block a user