File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131
3232#include "shared-bindings/audiocore/RawSample.h"
3333#include "shared-bindings/audiocore/WaveFile.h"
34+ #include "supervisor/shared/tick.h"
3435
3536#include "py/mpstate.h"
3637#include "py/runtime.h"
@@ -60,6 +61,7 @@ void audio_dma_free_channel(uint8_t channel) {
6061 assert (audio_dma_allocated [channel ]);
6162 audio_dma_disable_channel (channel );
6263 audio_dma_allocated [channel ] = false;
64+ supervisor_disable_tick ();
6365}
6466
6567void audio_dma_disable_channel (uint8_t channel ) {
@@ -71,6 +73,7 @@ void audio_dma_disable_channel(uint8_t channel) {
7173void audio_dma_enable_channel (uint8_t channel ) {
7274 if (channel >= AUDIO_DMA_CHANNEL_COUNT )
7375 return ;
76+ supervisor_enable_tick ();
7477 dma_enable_channel (channel );
7578}
7679
@@ -318,6 +321,9 @@ void audio_dma_reset(void) {
318321 for (uint8_t i = 0 ; i < AUDIO_DMA_CHANNEL_COUNT ; i ++ ) {
319322 audio_dma_state [i ] = NULL ;
320323 audio_dma_pending [i ] = false;
324+ if (audio_dma_allocated [i ]) {
325+ supervisor_disable_tick ();
326+ }
321327 audio_dma_allocated [i ] = false;
322328 audio_dma_disable_channel (i );
323329 dma_descriptor (i )-> BTCTRL .bit .VALID = false;
You can’t perform that action at this time.
0 commit comments