diff --git a/ports/raspberrypi/supervisor/internal_flash.c b/ports/raspberrypi/supervisor/internal_flash.c index 42223b29e3..f5dff80d72 100644 --- a/ports/raspberrypi/supervisor/internal_flash.c +++ b/ports/raspberrypi/supervisor/internal_flash.c @@ -99,11 +99,15 @@ void port_internal_flash_flush(void) { // Make sure we don't have an interrupt while we do flash operations. common_hal_mcu_disable_interrupts(); // and audio DMA must be paused as well + #if CIRCUITPY_AUDIOCORE uint32_t channel_mask = audio_dma_pause_all(); + #endif flash_range_erase(CIRCUITPY_CIRCUITPY_DRIVE_START_ADDR + _cache_lba, SECTOR_SIZE); flash_range_program(CIRCUITPY_CIRCUITPY_DRIVE_START_ADDR + _cache_lba, _cache, SECTOR_SIZE); _cache_lba = NO_CACHE; + #if CIRCUITPY_AUDIOCORE audio_dma_unpause_mask(channel_mask); + #endif common_hal_mcu_enable_interrupts(); }