Hi all,
I currently have a pair of DMA channels, driven by PIO state machines that have interrupts enabled on them so that I can take some action once the DMA has completed, they are setup with code like this :
Then the other channel is setup to use dma_hw->ints1.
However I'm now trying to integrate this with a project using scanvideo which seems to use ints0 itself, so I guess I'm going to have to use a shared IRQ handler.
Would something like this :
With the handler like this ( obviously this is just skeleton code I'd actually be doing some stuff in the if branches and then learing the IRQ).:
Be the correct way to go?
Cheers.
Phill.
I currently have a pair of DMA channels, driven by PIO state machines that have interrupts enabled on them so that I can take some action once the DMA has completed, they are setup with code like this :
Code:
dma_channel_set_irq0_enabled(ReadDMA2, true); irq_set_exclusive_handler(DMA_IRQ_0, ReadDMA_Handler); irq_set_enabled(DMA_IRQ_0, true); // Clear the interrupt request. dma_hw->ints0 = 1u << ReadDMA2; However I'm now trying to integrate this with a project using scanvideo which seems to use ints0 itself, so I guess I'm going to have to use a shared IRQ handler.
Would something like this :
Code:
dma_channel_set_irq1_enabled(ReadDMA2, true); irq_add_shared_handler(ReadDMA_IRQ, ReadWriteDMA_Handler, 0xFF); irq_set_enabled(ReadDMA_IRQ, true); // Clear the interrupt request. dma_hw->ints0 = 1u << ReadDMA2; Code:
void __no_inline_not_in_flash_func(ReadWriteDMA_Handler()){ // Check to see if IRQ caused by read or write? if(dma_hw->ints1 & (1u << ReadDMA_IRQ)) { dma_hw->ints0 = 1u << ReadDMA2; } else { dma_hw->ints0 = 1u << WriteDMA2; }Cheers.
Phill.
Statistics: Posted by PhillHS — Wed Feb 25, 2026 7:48 pm — Replies 6 — Views 77