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

Tone: allow running indefinitely when called without duration #59

Merged
merged 1 commit into from
Apr 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cores/arduino/Tone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class Tone {

void start(void) {
ticker.attach(mbed::callback(this, &Tone::toggle), 0.5f / float(frequency));
start_timeout();
if (duration != 0) {
start_timeout();
}
}

void toggle() {
Expand Down