nrf: i2sout: Ensure hardware I2S is stopped at deinit

.. otherwise, it may be possible under some scenario, for the background
task to continue and overwrite unrelated memory.
This commit is contained in:
Jeff Epler 2019-11-22 14:15:07 -06:00
parent aabb56c840
commit 1c6c9a3e1f
1 changed files with 2 additions and 0 deletions

View File

@ -221,6 +221,8 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) {
if (common_hal_audiobusio_i2sout_deinited(self)) {
return;
}
NRF_I2S->TASKS_STOP = 1;
NRF_I2S->ENABLE = I2S_ENABLE_ENABLE_Disabled;
reset_pin_number(self->bit_clock_pin_number);
self->bit_clock_pin_number = 0xff;
reset_pin_number(self->word_select_pin_number);