Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/rp2_common/hardware_dma/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ void dma_channel_cleanup(uint channel) {
// Disable CHAIN_TO, and disable channel, so that it ignores any further triggers
hw_write_masked( &dma_hw->ch[channel].al1_ctrl, (channel << DMA_CH0_CTRL_TRIG_CHAIN_TO_LSB) | (0u << DMA_CH0_CTRL_TRIG_EN_LSB), DMA_CH0_CTRL_TRIG_CHAIN_TO_BITS | DMA_CH0_CTRL_TRIG_EN_BITS );
// disable IRQs first as abort can cause spurious IRQs
dma_channel_set_irq0_enabled(channel, false);
dma_channel_set_irq1_enabled(channel, false);
for(uint i=0; i < NUM_DMA_IRQS; i++) {
dma_irqn_set_channel_enabled(i, channel, false);
}
dma_channel_abort(channel);
// finally clear the IRQ status, which may have been set during abort
dma_hw->intr = 1u << channel;
Expand Down
Loading