Skip to content

Commit 81a90d1

Browse files
committed
Fix hang in noTone()
1 parent 78c979a commit 81a90d1

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)