We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c07fda7 commit 746d79dCopy full SHA for 746d79d
ports/rp2/rp2_dma.c
@@ -471,6 +471,25 @@ void rp2_dma_init(void) {
471
}
472
473
void rp2_dma_deinit(void) {
474
+ // Reset all DMA channel registers to their default values.
475
+ dma_channel_config config = { .ctrl = 0 };
476
+ for (uint i = 0; i < NUM_DMA_CHANNELS; i++) {
477
+ dma_channel_configure(
478
+ i,
479
+ &config,
480
+ NULL,
481
482
+ 0,
483
+ false
484
+ );
485
+ }
486
+
487
+ // Abort all DMA channels. Must be done after clearing EN bits in control
488
+ // registers due to errata RP2350-E5.
489
490
+ dma_channel_abort(i);
491
492
493
// Remove our interrupt handler.
494
irq_remove_handler(DMA_IRQ_0, rp2_dma_irq_handler);
495
0 commit comments