diff --git a/ports/atmel-samd/audio_dma.c b/ports/atmel-samd/audio_dma.c index adf62942c1..481a420cbc 100644 --- a/ports/atmel-samd/audio_dma.c +++ b/ports/atmel-samd/audio_dma.c @@ -35,6 +35,8 @@ #include "py/mpstate.h" #include "py/runtime.h" +#if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO + static audio_dma_t* audio_dma_state[AUDIO_DMA_CHANNEL_COUNT]; // This cannot be in audio_dma_state because it's volatile. @@ -348,3 +350,4 @@ void audio_dma_background(void) { audio_dma_pending[i] = false; } } +#endif diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c index 4e88d34e79..6942380706 100644 --- a/ports/atmel-samd/background.c +++ b/ports/atmel-samd/background.c @@ -56,7 +56,7 @@ void run_background_tasks(void) { assert_heap_ok(); running_background_tasks = true; - #if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAMD51) + #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO audio_dma_background(); #endif #if CIRCUITPY_DISPLAYIO