Skip to content

Commit d8dd5bf

Browse files
committed
fix bug where repeat was specified with no interval stored
1 parent c2e807a commit d8dd5bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/arduino-timer-cpp17.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,12 @@ class TimerSet {
248248
remove(timer);
249249
break;
250250
case TimerStatus::repeat:
251-
timer.start = now;
252-
timer.expires = timer.repeat;
251+
if (timer.repeat > 0) {
252+
timer.start = now;
253+
timer.expires = timer.repeat;
254+
} else {
255+
remove(timer);
256+
}
253257
break;
254258
case TimerStatus::reschedule:
255259
timer.start = now;

0 commit comments

Comments
 (0)