Skip to content

Commit 1c6c9a3

Browse files
committed
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.
1 parent aabb56c commit 1c6c9a3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ports/nrf/common-hal/audiobusio/I2SOut.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) {
221221
if (common_hal_audiobusio_i2sout_deinited(self)) {
222222
return;
223223
}
224+
NRF_I2S->TASKS_STOP = 1;
225+
NRF_I2S->ENABLE = I2S_ENABLE_ENABLE_Disabled;
224226
reset_pin_number(self->bit_clock_pin_number);
225227
self->bit_clock_pin_number = 0xff;
226228
reset_pin_number(self->word_select_pin_number);

0 commit comments

Comments
 (0)