Skip to content

Commit 6f41c22

Browse files
authored
Merge pull request #375 from adafruit/fix-hang-notone
Fix hang in noTone()
2 parents 78c979a + 81a90d1 commit 6f41c22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cores/arduino/Tone.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@ void noTone (uint32_t outputPin)
195195
*/
196196
if(firstTimeRunning)
197197
{
198+
NVIC_DisableIRQ(TONE_TC_IRQn);
198199
resetTC(TONE_TC);
200+
NVIC_EnableIRQ(TONE_TC_IRQn);
201+
199202
digitalWrite(outputPin, LOW);
200203
toneIsActive = false;
201204
}

0 commit comments

Comments
 (0)