Skip to content

Commit 07a4524

Browse files
committed
Issue arduino#723 - Fix hang in noTone()
1 parent 993398c commit 07a4524

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
@@ -169,7 +169,10 @@ void noTone (uint8_t outputPin)
169169
*/
170170
if(firstTimeRunning)
171171
{
172+
NVIC_DisableIRQ(TONE_TC_IRQn);
172173
resetTC(TONE_TC);
174+
NVIC_EnableIRQ(TONE_TC_IRQn);
175+
173176
digitalWrite(outputPin, LOW);
174177
toneIsActive = false;
175178
}

0 commit comments

Comments
 (0)