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 {
3434 public:
3535 I2SStream () = default ;
3636 ~I2SStream () { end (); }
37-
37+
3838#ifdef ARDUINO
3939 I2SStream (int mute_pin) {
4040 TRACED ();
@@ -83,10 +83,12 @@ class I2SStream : public AudioStream {
8383
8484 // / Stops the I2S interface
8585 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+ }
9092 }
9193
9294 // / updates the sample rate dynamically
@@ -143,7 +145,7 @@ class I2SStream : public AudioStream {
143145
144146 protected:
145147 I2SDriver i2s;
146- int mute_pin;
148+ int mute_pin = - 1 ;
147149 bool is_active = false ;
148150
149151 // / set mute pin on or off
You can’t perform that action at this time.
0 commit comments