File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/AudioTools/CoreAudio/AudioI2S Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class I2SStream : public AudioStream {
34
34
public:
35
35
I2SStream () = default ;
36
36
~I2SStream () { end (); }
37
-
37
+
38
38
#ifdef ARDUINO
39
39
I2SStream (int mute_pin) {
40
40
TRACED ();
@@ -83,10 +83,12 @@ class I2SStream : public AudioStream {
83
83
84
84
// / Stops the I2S interface
85
85
void end () {
86
- TRACEI ();
87
- is_active = false ;
88
- mute (true );
89
- i2s.end ();
86
+ if (is_active) {
87
+ TRACEI ();
88
+ is_active = false ;
89
+ mute (true );
90
+ i2s.end ();
91
+ }
90
92
}
91
93
92
94
// / updates the sample rate dynamically
@@ -143,7 +145,7 @@ class I2SStream : public AudioStream {
143
145
144
146
protected:
145
147
I2SDriver i2s;
146
- int mute_pin;
148
+ int mute_pin = - 1 ;
147
149
bool is_active = false ;
148
150
149
151
// / set mute pin on or off
You can’t perform that action at this time.
0 commit comments