Skip to content

Commit fae6e29

Browse files
committed
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
1 parent ef45932 commit fae6e29

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ void common_hal_audiopwmio_pwmaudioout_deinit(audiopwmio_pwmaudioout_obj_t* self
194194
if (common_hal_audiopwmio_pwmaudioout_deinited(self)) {
195195
return;
196196
}
197+
deactivate_audiopwmout_obj(self);
198+
197199
// TODO: ramp the pwm down from quiescent value to 0
198200
self->pwm->ENABLE = 0;
199201

0 commit comments

Comments
 (0)