You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* Calls handler with opaque as argument in delay units of time */
79
-
bool in(unsigned long delay, handler_t handler, void *opaque = NULL);
85
+
Timer<>::Task
86
+
in(unsigned long delay, handler_t handler, void *opaque = NULL);
80
87
81
88
/* Calls handler with opaque as argument at time */
82
-
bool at(unsigned long time, handler_t handler, void *opaque = NULL);
89
+
Timer<>::Task
90
+
at(unsigned long time, handler_t handler, void *opaque = NULL);
83
91
84
92
/* Calls handler with opaque as argument every interval units of time */
85
-
bool every(unsigned long interval, handler_t handler, void *opaque = NULL);
93
+
Timer<>::Task
94
+
every(unsigned long interval, handler_t handler, void *opaque = NULL);
95
+
96
+
/* Cancel a timer task */
97
+
void cancel(Timer<>::Task &task);
86
98
```
87
99
88
100
### Installation
@@ -129,7 +141,9 @@ Currently only a software timer. Any blocking code delaying *timer*.**tick()** w
129
141
130
142
The library does not do any dynamic memory allocation.
131
143
132
-
The number of concurrent tasks is a compile time constant, meaning there is a limit to the number of concurrent tasks. The **in / at / every** functions return **false** if the *Timer* is full.
144
+
The number of concurrent tasks is a compile time constant, meaning there is a limit to the number of concurrent tasks. The **in / at / every** functions return **NULL** if the *Timer* is full.
145
+
146
+
A *Task* value is valid only for the timer that created it, and only for the lifetime of that timer.
133
147
134
148
Change the number of concurrent tasks using the *Timer* constructors. Save memory by reducing the number, increase memory use by having more. The default is **TIMER_MAX_TASKS** which is currently 16.
0 commit comments