Skip to content

Commit 4a6d6ee

Browse files
Rocketctsandeepmistry
authored andcommitted
fix freeze due to tone()
In file Tone.cpp added suffix -1LL to the costant in line 117 in order to avoid freeze for instance of tone(pin, 35000);
1 parent bab730b commit 4a6d6ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/Tone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void tone (uint32_t outputPin, uint32_t frequency, uint32_t duration)
114114
default: break;
115115
}
116116

117-
toggleCount = (duration > 0 ? frequency * duration * 2 / 1000UL : -1);
117+
toggleCount = (duration > 0 ? frequency * duration * 2 / 1000UL : -1LL);
118118

119119
resetTC(TONE_TC);
120120

0 commit comments

Comments
 (0)