Skip to content

Commit aafd946

Browse files
committed
AudioDriverLyratMiniClass: changed begin logic
1 parent d97d627 commit aafd946

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/Driver.h

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,23 +1423,22 @@ class AudioDriverLyratMiniClass : public AudioDriver {
14231423
// setup SPI for SD
14241424
pins.setSPIActiveForSD(codecCfg.sd_active);
14251425

1426-
// Start ADC
1426+
// Start ES7243
14271427
bool ok = true;
1428+
1429+
// Start ES8311
1430+
AD_LOGI("starting ES8311");
1431+
dac.setPins(this->pins());
1432+
ok = dac.setConfig(codecCfg);
1433+
setPAPower(true);
1434+
setVolume(DRIVER_DEFAULT_VOLUME);
1435+
14281436
if (codecCfg.input_device != ADC_INPUT_NONE){
1429-
AD_LOGI("starting ADC");
1430-
dac.setPins(this->pins());
1437+
AD_LOGI("starting ES7243");
1438+
adc.setPins(this->pins());
14311439
ok = ok && adc.setConfig(codecCfg);
14321440
}
14331441

1434-
// Start DAC
1435-
if (codecCfg.output_device != DAC_OUTPUT_NONE){
1436-
AD_LOGI("starting DAC");
1437-
dac.setPins(this->pins());
1438-
ok = dac.setConfig(codecCfg);
1439-
setPAPower(true);
1440-
setVolume(DRIVER_DEFAULT_VOLUME);
1441-
}
1442-
14431442
if (!ok) {
14441443
AD_LOGI("AudioDriverLyratMiniClass::begin failed");
14451444
}

0 commit comments

Comments
 (0)