Don't use "cookie" variable/function name

This commit is contained in:
Jeff Epler 2023-06-27 09:59:02 -05:00
parent b4be2317cb
commit 385366128f
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
3 changed files with 5 additions and 5 deletions

View File

@ -400,10 +400,10 @@ uint32_t audio_dma_pause_all(void) {
return result; return result;
} }
void audio_dma_unpause_cookie(uint32_t cookie) { void audio_dma_unpause_mask(uint32_t channel_mask) {
for (size_t channel = 0; channel < NUM_DMA_CHANNELS; channel++) { for (size_t channel = 0; channel < NUM_DMA_CHANNELS; channel++) {
audio_dma_t *dma = MP_STATE_PORT(playing_audio)[channel]; audio_dma_t *dma = MP_STATE_PORT(playing_audio)[channel];
if (dma != NULL && (cookie & (1 << channel))) { if (dma != NULL && (channel_mask & (1 << channel))) {
audio_dma_resume(dma); audio_dma_resume(dma);
} }
} }

View File

@ -90,6 +90,6 @@ void audio_dma_resume(audio_dma_t *dma);
bool audio_dma_get_paused(audio_dma_t *dma); bool audio_dma_get_paused(audio_dma_t *dma);
uint32_t audio_dma_pause_all(void); uint32_t audio_dma_pause_all(void);
void audio_dma_unpause_cookie(uint32_t cookie); void audio_dma_unpause_mask(uint32_t channel_mask);
#endif // MICROPY_INCLUDED_RASPBERRYPI_AUDIO_DMA_OUT_H #endif // MICROPY_INCLUDED_RASPBERRYPI_AUDIO_DMA_OUT_H

View File

@ -99,11 +99,11 @@ void port_internal_flash_flush(void) {
// Make sure we don't have an interrupt while we do flash operations. // Make sure we don't have an interrupt while we do flash operations.
common_hal_mcu_disable_interrupts(); common_hal_mcu_disable_interrupts();
// and audio DMA must be paused as well // and audio DMA must be paused as well
uint32_t cookie = audio_dma_pause_all(); uint32_t channel_mask = audio_dma_pause_all();
flash_range_erase(CIRCUITPY_CIRCUITPY_DRIVE_START_ADDR + _cache_lba, SECTOR_SIZE); 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); flash_range_program(CIRCUITPY_CIRCUITPY_DRIVE_START_ADDR + _cache_lba, _cache, SECTOR_SIZE);
_cache_lba = NO_CACHE; _cache_lba = NO_CACHE;
audio_dma_unpause_cookie(cookie); audio_dma_unpause_mask(channel_mask);
common_hal_mcu_enable_interrupts(); common_hal_mcu_enable_interrupts();
} }