mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
disable all IRQs in dma_chanel_cleanup - fixes for RP2350 (#2060)
This commit is contained in:
parent
6bb44dd07d
commit
9762b00c13
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue