File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
src/AudioTools/CoreAudio/AudioI2S Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -289,30 +289,27 @@ class I2SDriverESP32V1 {
289289 soc_periph_i2s_clk_src_t getClockSource (I2SConfigESP32V1 &cfg){
290290 soc_periph_i2s_clk_src_t result = I2S_CLK_SRC_DEFAULT;
291291 // use mclk pin as input in slave mode if supported
292- bool is_pin_mck_input = false ;
292+ bool is_pin_mck_output = true ;
293293 if (cfg.pin_mck != -1 ) {
294294 if (!cfg.is_master ) {
295295#if SOC_I2S_HW_VERSION_2
296296 LOGI (" pin_mclk is input" );
297297 result = I2S_CLK_SRC_EXTERNAL;
298- is_pin_mck_input = true ;
298+ is_pin_mck_output = false ;
299299#else
300300 LOGE (" pin_mclk as input not supported" );
301301#endif
302302 }
303303
304- if (!is_pin_mck_input) {
304+ // select APLL clock if possible
305+ if (is_pin_mck_output && cfg.use_apll ) {
305306 // select clock source
306307#if SOC_I2S_SUPPORTS_APLL
307- if (cfg.use_apll ) {
308308 result = I2S_CLK_SRC_APLL;
309309 LOGI (" clk_src is I2S_CLK_SRC_APLL" );
310- }
311310#elif SOC_I2S_SUPPORTS_PLL_F160M
312- if (cfg.use_apll ) {
313311 result = I2S_CLK_SRC_PLL_160M;
314312 LOGI (" clk_src is I2S_CLK_SRC_PLL_160M" );
315- }
316313#endif
317314 }
318315 }
You can’t perform that action at this time.
0 commit comments