Skip to content

Commit a63a412

Browse files
committed
Do not close Wire on end()
1 parent 7861a54 commit a63a412

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/AudioDriverConfig.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# define DRIVER_DEFAULT_VOLUME 70
66
#endif
77

8-
98
// To increase the max volume e.g. for ai_thinker (ES8388) 2957 or A202 -> set
109
// to 1 or 2 0 AUX volume is LINE level 1 you can control the AUX volume with
1110
// setVolume()
@@ -20,10 +19,14 @@
2019
# define ES8388_DEFAULT_INPUT_GAIN 25
2120
#endif
2221

23-
2422
// For AI Thinker Audiokit we mute the power amplifier if the line is defined;
2523
// set to -1 to deactivate this functionality
26-
#ifndef ES8388_PA_LINE
24+
#ifndef ES8388_PA_LINE
2725
# define ES8388_PA_LINE 1
2826
#endif
2927

28+
// If set to true, call Wire.close() on end: this might cause that the
29+
// functionality can not be restarted
30+
#ifndef FORCE_WIRE_CLOSE
31+
# define FORCE_WIRE_CLOSE false
32+
#endif

src/DriverPins.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ struct PinsI2C {
200200
return true;
201201
}
202202
void end() {
203-
#ifndef ESP8266
204-
p_wire->end();
203+
#if !defined(ESP8266) && FORCE_WIRE_CLOSE
204+
p_wire->end();
205205
#endif
206206
}
207207
};

0 commit comments

Comments
 (0)