Skip to content

Commit 5fb0ef1

Browse files
committed
AudioDriverES8388Class
1 parent c8e7ee0 commit 5fb0ef1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Driver.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ class AudioDriverES7243eClass : public AudioDriver {
653653
};
654654

655655
/**
656-
* @brief Driver API for ES8388 codec chip
656+
* @brief Driver API for ES8156 codec chip
657657
* @author Phil Schatzmann
658658
* @copyright GPLv3
659659
*/
@@ -774,10 +774,13 @@ class AudioDriverES8374Class : public AudioDriver {
774774
*/
775775
class AudioDriverES8388Class : public AudioDriver {
776776
public:
777-
bool setMute(bool mute) { return es8388_set_voice_mute(mute) == RESULT_OK; }
777+
bool setMute(bool mute) {
778+
line_active[0] = !mute;
779+
line_active[1] = !mute;
780+
return es8388_set_voice_mute(mute) == RESULT_OK;
781+
}
778782
// mute line: lines start at 0
779783
bool setMute(bool mute, int line) {
780-
bool line_active[2];
781784
if (line > 1) {
782785
AD_LOGD("invalid line %d", line);
783786
return false;
@@ -820,6 +823,8 @@ class AudioDriverES8388Class : public AudioDriver {
820823
bool isInputVolumeSupported() { return true; }
821824

822825
protected:
826+
bool line_active[2] = {true};
827+
823828
bool init(codec_config_t codec_cfg) {
824829
return es8388_init(&codec_cfg, getI2C()) == RESULT_OK;
825830
}

0 commit comments

Comments
 (0)