We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e6f9bd commit 3124d31Copy full SHA for 3124d31
src/arduino-timer.h
@@ -116,8 +116,8 @@ class Timer {
116
117
/* Left until the task ends */
118
unsigned long
119
- ticks(const Task &task)
120
- {
+ left(const Task &task)
+ {
121
auto lft = 0ul;
122
if (!task)
123
return lft;
@@ -127,10 +127,8 @@ class Timer {
127
const unsigned long now = time_func();
128
const unsigned long duration = now - t->start;
129
130
- if (duration >= t->expires)
131
- break;
132
-
133
- lft = t->expires - duration;
+ if (duration < t->expires)
+ lft = t->expires - duration;
134
break;
135
}
136
0 commit comments