diff options
| author | Jeff Epler <jepler@gmail.com> | 2019-10-12 14:00:04 +0900 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2019-10-12 14:01:35 +0900 |
| commit | fae6e295460208c18bb2293c8d311ee8942e10d7 (patch) | |
| tree | 037765d4d9ba42b43d2adeb2b44afa044ed04295 /ports/nrf | |
| parent | ef459326cbd00188a047680ad2d80518cf396ea3 (diff) | |
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
Diffstat (limited to 'ports/nrf')
| -rw-r--r-- | ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index 2a284b362..9496277b1 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -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; |
