Skip to content

Commit a1ebc12

Browse files
authored
Merge pull request #314 from pennam/portenta_pdm_restart_fix
Fix PDM restart issue on portenta H7
2 parents e991842 + 0f4da2d commit a1ebc12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libraries/PDM/src/stm32/audio.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ int py_audio_init(size_t channels, uint32_t frequency, int gain_db, float highpa
194194
return 0;
195195
} else {
196196
g_o_channels = channels;
197+
g_i_channels = AUDIO_SAI_NBR_CHANNELS;
197198
}
198199

199200
uint32_t decimation_factor = 64; // Fixed decimation factor
@@ -344,8 +345,8 @@ void py_audio_deinit()
344345
hdma_sai_rx.Instance = NULL;
345346
}
346347

347-
g_i_channels = 0;
348-
g_o_channels = 0;
348+
g_i_channels = AUDIO_SAI_NBR_CHANNELS;
349+
g_o_channels = AUDIO_SAI_NBR_CHANNELS;
349350
//free(g_pcmbuf);
350351
g_pcmbuf = NULL;
351352
}

0 commit comments

Comments
 (0)