Initialize pacing timer

This commit is contained in:
root 2021-05-30 12:12:38 -05:00
parent a2b220370e
commit 8761e4bfd7

View File

@ -102,6 +102,7 @@ void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t *s
}
audio_dma_init(&self->dma);
self->pacing_timer = NUM_DMA_TIMERS;
self->quiescent_value = quiescent_value;
}
@ -127,11 +128,9 @@ void common_hal_audiopwmio_pwmaudioout_deinit(audiopwmio_pwmaudioout_obj_t *self
void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t *self, mp_obj_t sample, bool loop) {
if (self->dma.channel[0] < NUM_DMA_CHANNELS) {
if (common_hal_audiopwmio_pwmaudioout_get_playing(self)) {
common_hal_audiopwmio_pwmaudioout_stop(self);
}
}
// TODO: Share pacing timers based on frequency.
size_t pacing_timer = NUM_DMA_TIMERS;