Changes to correct repeat playing on a channel
This commit is contained in:
parent
24e641a834
commit
760e8c77bd
|
@ -352,6 +352,8 @@ bool audio_dma_get_paused(audio_dma_t *dma) {
|
|||
void audio_dma_init(audio_dma_t *dma) {
|
||||
dma->first_buffer = NULL;
|
||||
dma->second_buffer = NULL;
|
||||
dma->channel[0] = NUM_DMA_CHANNELS;
|
||||
dma->channel[1] = NUM_DMA_CHANNELS;
|
||||
}
|
||||
|
||||
void audio_dma_deinit(audio_dma_t *dma) {
|
||||
|
|
|
@ -127,6 +127,12 @@ 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;
|
||||
for (size_t i = 0; i < NUM_DMA_TIMERS; i++) {
|
||||
|
|
Loading…
Reference in New Issue