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 a90f1ff commit 6e6f9bdCopy full SHA for 6e6f9bd
src/arduino-timer.h
@@ -114,6 +114,30 @@ class Timer {
114
}
115
116
117
+ /* Left until the task ends */
118
+ unsigned long
119
+ ticks(const Task &task)
120
+ {
121
+ auto lft = 0ul;
122
+ if (!task)
123
+ return lft;
124
+
125
+ timer_foreach_task(t) {
126
+ if (t->handler && task_id(t) == task) {
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;
134
135
+ }
136
137
138
139
140
141
/* Ticks the timer forward - call this function in loop() */
142
unsigned long
143
tick()
0 commit comments