Skip to content

Commit 3ff1ae4

Browse files
committed
Tone: allow running indefinitely when called without duration
1 parent 6191791 commit 3ff1ae4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cores/arduino/Tone.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ class Tone {
2222

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

2830
void toggle() {

0 commit comments

Comments
 (0)