diff --git a/hardware/arduino/cores/arduino/Tone.cpp b/hardware/arduino/cores/arduino/Tone.cpp index 8bdc5f771..c3910e7a6 100755 --- a/hardware/arduino/cores/arduino/Tone.cpp +++ b/hardware/arduino/cores/arduino/Tone.cpp @@ -533,8 +533,12 @@ ISR(TIMER2_COMPA_vect) } else { - disableTimer(2); - *timer2_pin_port &= ~(timer2_pin_mask); // keep pin low after stop + // need to call noTone() so that the tone_pins[] entry is reset, so the + // timer gets initialized next time we call tone(). + // XXX: this assumes timer 2 is always the first one used. + noTone(tone_pins[0]); +// disableTimer(2); +// *timer2_pin_port &= ~(timer2_pin_mask); // keep pin low after stop } }