Skip to content

Commit 3124d31

Browse files
committed
Renamed ticks() to left(), minor style update
Signed-off-by: Greg <sixtelgreg@gmail.com>
1 parent 6e6f9bd commit 3124d31

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/arduino-timer.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ class Timer {
116116

117117
/* Left until the task ends */
118118
unsigned long
119-
ticks(const Task &task)
120-
{
119+
left(const Task &task)
120+
{
121121
auto lft = 0ul;
122122
if (!task)
123123
return lft;
@@ -127,10 +127,8 @@ class Timer {
127127
const unsigned long now = time_func();
128128
const unsigned long duration = now - t->start;
129129

130-
if (duration >= t->expires)
131-
break;
132-
133-
lft = t->expires - duration;
130+
if (duration < t->expires)
131+
lft = t->expires - duration;
134132
break;
135133
}
136134
}

0 commit comments

Comments
 (0)