Skip to content

Commit 8761e4b

Browse files
committed
Initialize pacing timer
1 parent a2b2203 commit 8761e4b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t *s
102102
}
103103

104104
audio_dma_init(&self->dma);
105+
self->pacing_timer = NUM_DMA_TIMERS;
105106

106107
self->quiescent_value = quiescent_value;
107108
}
@@ -127,10 +128,8 @@ void common_hal_audiopwmio_pwmaudioout_deinit(audiopwmio_pwmaudioout_obj_t *self
127128

128129
void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t *self, mp_obj_t sample, bool loop) {
129130

130-
if (self->dma.channel[0] < NUM_DMA_CHANNELS) {
131-
if (common_hal_audiopwmio_pwmaudioout_get_playing(self)) {
132-
common_hal_audiopwmio_pwmaudioout_stop(self);
133-
}
131+
if (common_hal_audiopwmio_pwmaudioout_get_playing(self)) {
132+
common_hal_audiopwmio_pwmaudioout_stop(self);
134133
}
135134

136135
// TODO: Share pacing timers based on frequency.

0 commit comments

Comments
 (0)