Skip to content

Commit 89b649a

Browse files
committed
Deactivate SD for LyraT Mini
1 parent 154568c commit 89b649a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/Driver.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ class AudioDriverLyratMiniClass : public AudioDriver {
14211421
codec_cfg = codecCfg;
14221422

14231423
// setup SPI for SD
1424-
pins.setSPIActiveForSD(codecCfg.sd_active);
1424+
//pins.setSPIActiveForSD(codecCfg.sd_active);
14251425

14261426
bool ok = true;
14271427

src/Driver/es7210/es7210.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,14 @@ error_t es7210_adc_ctrl_state_active(codec_mode_t mode, bool ctrl_state_active)
430430

431431
error_t es7210_adc_set_gain(es7210_gain_value_t gain)
432432
{
433+
AD_LOGD( "es7210_adc_set_gain:%d", gain);
433434
error_t ret = RESULT_OK;
434435
uint32_t max_gain_vaule = 14;
435436
if (gain < 0) {
436437
gain = 0;
437438
} else if (gain > max_gain_vaule) {
438439
gain = max_gain_vaule;
439440
}
440-
AD_LOGD( "SET: gain:%d", gain);
441441
if (mic_select & ES7210_INPUT_MIC1) {
442442
ret |= es7210_update_reg_bit(ES7210_MIC1_ES7210_GAIN_REG43, 0x0f, gain);
443443
}

src/Driver/es7243/es7243.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,13 @@ error_t es7243_adc_config_i2s(codec_mode_t mode, I2SDefinition *iface) {
140140

141141
error_t es7243_adc_set_voice_mute(bool mute) {
142142
AD_LOGI("es7243_adc_set_voice_mute es7243_mute(), mute = %d", mute);
143+
error_t ret = RESULT_OK;
143144
if (mute) {
144-
es7243_write_reg(0x05, 0x1B);
145+
ret = es7243_write_reg(0x05, 0x1B);
145146
} else {
146-
es7243_write_reg(0x05, 0x13);
147+
ret = es7243_write_reg(0x05, 0x13);
147148
}
148-
return RESULT_OK;
149+
return ret;
149150
}
150151

151152
error_t es7243_adc_set_voice_volume(int volume) {
@@ -186,7 +187,7 @@ error_t es7243_adc_set_voice_volume(int volume) {
186187
default:
187188
break;
188189
}
189-
return RESULT_OK;
190+
return ret;
190191
}
191192

192193
error_t es7243_adc_get_voice_volume(int *volume) {

src/Driver/es8311/es8311.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ error_t es8311_stop(codec_mode_t mode)
628628

629629
error_t es8311_codec_set_voice_volume(int volume)
630630
{
631+
AD_LOGD( "es8311_codec_set_voice_volume:%d", volume);
631632
if (i2c_handle == 0) return RESULT_FAIL;
632633
error_t res = RESULT_OK;
633634
if (volume < 0) {
@@ -636,7 +637,6 @@ error_t es8311_codec_set_voice_volume(int volume)
636637
volume = 100;
637638
}
638639
int vol = (volume) * 2550 / 1000;
639-
AD_LOGD( "SET: volume:%d", vol);
640640
es8311_write_reg(ES8311_DAC_REG32, vol);
641641
return res;
642642
}

src/DriverPins.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ class DriverPins {
471471
for (auto &tmp : pins) {
472472
if (tmp.pin != -1) {
473473
if (!hasConflict(tmp.pin)) {
474-
AD_LOGD("pinMode %d", tmp.pin);
474+
AD_LOGD("pinMode for %d", tmp.pin);
475475
switch (tmp.pin_logic) {
476476
case PinLogic::InputActiveHigh:
477477
pinMode(tmp.pin, INPUT);
@@ -496,7 +496,6 @@ class DriverPins {
496496
} else {
497497
AD_LOGD("Pin is -1");
498498
}
499-
AD_LOGD("Pin %d set", tmp.pin);
500499
}
501500
}
502501

@@ -621,8 +620,8 @@ class PinsLyratMiniClass : public DriverPins {
621620
public:
622621

623622
PinsLyratMiniClass() {
624-
// sd pins: CLK, MISO, MOSI, CS
625-
addSPI(ESP32PinsSD);
623+
// sd pins: CLK, MISO, MOSI, CS: the SD is not working, so this is commented out
624+
// addSPI(ESP32PinsSD);
626625
// add i2c codec pins: scl, sda, port, frequency
627626
addI2C(PinFunction::CODEC, 23, 18);
628627
// add i2s pins: mclk, bck, ws,data_out, data_in ,(port)

0 commit comments

Comments
 (0)