Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Commit 548a18e

Browse files
authored
Merge pull request #59 from facchinm/tone_infinite
Tone: allow running indefinitely when called without duration
2 parents 7ae9704 + 40cbe0d commit 548a18e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cores/arduino/Tone.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ class Tone {
2121

2222
void start(void) {
2323
ticker.attach(mbed::callback(this, &Tone::toggle), 0.5f / float(frequency));
24-
start_timeout();
24+
if (duration != 0) {
25+
start_timeout();
26+
}
2527
}
2628

2729
void toggle() {

0 commit comments

Comments
 (0)