nrf: PWMAudioOut: deactivate PWM when deinitting self

.. otherwise, when an AudioPWMOut object was deinitted without being
explicitly stop()ped, it would use up a slot in active_audio[]; the
5th iteration would create a non-working audio object which would just
buzz instead of playing the right thing.

Closes: #2203
This commit is contained in:
Jeff Epler 2019-10-12 14:00:04 +09:00
parent ef459326cb
commit fae6e29546

View File

@ -194,6 +194,8 @@ void common_hal_audiopwmio_pwmaudioout_deinit(audiopwmio_pwmaudioout_obj_t* self
if (common_hal_audiopwmio_pwmaudioout_deinited(self)) {
return;
}
deactivate_audiopwmout_obj(self);
// TODO: ramp the pwm down from quiescent value to 0
self->pwm->ENABLE = 0;