Skip to content

Commit

Permalink
disable all IRQs in dma_chanel_cleanup - fixes for RP2350
Browse files Browse the repository at this point in the history
  • Loading branch information
kilograham committed Nov 19, 2024
1 parent 482dd59 commit ae7164e
Showing 1 changed file with 3 additions and 2 deletions.
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(int 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

0 comments on commit ae7164e

Please sign in to comment.