disable all IRQs in dma_chanel_cleanup - fixes for RP2350 (#2060)

This commit is contained in:
Graham Sanderson 2024-11-21 16:52:04 -06:00 committed by GitHub
parent 6bb44dd07d
commit 9762b00c13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;