samd: AudioOut: ensure stopped before deinit
.. otherwise, a sequence like >>> a = audioio.AudioOut(board.A0) >>> a.play(sample, loop=True) >>> a.deinit() would potentially leave related DMA channel(s) active.
This commit is contained in:
parent
42956a62a3
commit
0b00787b4d
|
@ -312,6 +312,10 @@ void common_hal_audioio_audioout_deinit(audioio_audioout_obj_t* self) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (common_hal_audioio_audioout_get_playing(self)) {
|
||||
common_hal_audioio_audioout_stop(self);
|
||||
}
|
||||
|
||||
// Ramp the DAC down.
|
||||
ramp_value(self->quiescent_value, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue