Skip to content

Commit

Permalink
Additional guard delay after i2s_driver_uninstall
Browse files Browse the repository at this point in the history
Solving the problem of initialization of an I2S peripheral, in which it may be in an indeterminate state after a soft reset, in which the analog microphone does not work.
  • Loading branch information
phonec authored Nov 1, 2022
1 parent 47be839 commit 60b5b8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wled00/usermod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void userSetup() {
disableSoundProcessing = true; // just to be safe
// Reset I2S peripheral for good measure
i2s_driver_uninstall(I2S_NUM_0);
delay(100); // Give this peripheral time to disable to avoid an indeterminate state.
periph_module_reset(PERIPH_I2S0_MODULE);

delay(100); // Give that poor microphone some time to setup.
Expand Down Expand Up @@ -386,4 +387,4 @@ void usermod_updateInfo(void) {
audioStatusInfo[3][23] = '\0'; audioStatusInfo[4][23] = '\0';
audioStatusInfo[5][23] = '\0';
audioStatusInfo[6][23] = '\0';
}
}

0 comments on commit 60b5b8c

Please sign in to comment.