Merge pull request #8271 from FrameworkComputer/rp2040-no-audio

raspberrypi: Allow build without audio
This commit is contained in:
Dan Halbert 2023-08-09 08:53:35 -04:00 committed by GitHub
commit 7432bbce65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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();
}