ports/rp2/machine_i2s.c: Detect and deinitialize I2S instances on boot.

During early init some I2S instances may still be present in buffer.
This issue would cause system to hang when using soft_reset without
deinitializing I2S instance first.
pull/14345/head
Marek Ledworowski 2024-04-21 19:26:51 +02:00
rodzic d11ca092f7
commit 007c84b840
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 1B500F6D8472858F
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -167,6 +167,9 @@ static mp_obj_t machine_i2s_deinit(mp_obj_t self_in);
void machine_i2s_init0(void) {
for (uint8_t i = 0; i < MAX_I2S_RP2; i++) {
if (MP_STATE_PORT(machine_i2s_obj[i]) != NULL) {
mp_machine_i2s_deinit(MP_STATE_PORT(machine_i2s_obj[i]));
}
MP_STATE_PORT(machine_i2s_obj[i]) = NULL;
}
}