arduino-timer
arduino-timer copied to clipboard
Overloaded ticks() function, getting the ticks left for a specific task
Is it a good idea to overload a function name for two conceptually different return values? ticks() returns ticks until next event vs ticks(t) returns ticks until end of t. IMHO, this function should have a distinct name.
A minor style comment...
- if (duration >= t->expires)
- break;
-
- lft = t->expires - duration;
- break;
+ if (duration < t->expires)
+ lft = t->expires - duration;
+ break;