File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -448,6 +448,11 @@ void isr_dma_0(void) {
448
448
if ((dma_hw -> intr & mask ) == 0 ) {
449
449
continue ;
450
450
}
451
+ // acknowledge interrupt early. Doing so late means that you could lose an
452
+ // interrupt if the buffer is very small and the DMA operation
453
+ // completed by the time callback_add() / dma_complete() returned. This
454
+ // affected PIO continuous write more than audio.
455
+ dma_hw -> ints0 = mask ;
451
456
if (MP_STATE_PORT (playing_audio )[i ] != NULL ) {
452
457
audio_dma_t * dma = MP_STATE_PORT (playing_audio )[i ];
453
458
// Record all channels whose DMA has completed; they need loading.
@@ -458,7 +463,6 @@ void isr_dma_0(void) {
458
463
rp2pio_statemachine_obj_t * pio = MP_STATE_PORT (continuous_pio )[i ];
459
464
rp2pio_statemachine_dma_complete (pio , i );
460
465
}
461
- dma_hw -> ints0 = mask ;
462
466
}
463
467
}
464
468
You can’t perform that action at this time.
0 commit comments