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
Copy file name to clipboardexpand all lines: README.md
+22-19
Original file line number
Diff line number
Diff line change
@@ -30,11 +30,13 @@ illustrates the whole API and its best usage.
30
30
31
31
ChangeLog
32
32
---------
33
-
* version 1.1 adds clear example of DS18B20 handling
33
+
* version 1.4 changes the default priority value when <code>Tasker</code> is instantiated without the optional parameter. In previous versions the priority was enabled, now it is disabled. I (and also other users of **Tasker**) found the prioritized handling of tasks rather counter-intuitive because it could happen almost randomly that some tasks were sometimes not executed at all (when a higher priority task ran for too long). Whoever wants to keep the original behaviour please instantiate Tasker like this: <code>Tasker tasker(TRUE);</code>. There are also two new functions that help to query or set the priority value: <code>isPrioritized()</code> and <code>setPrioritized(bool)</code>.
34
+
35
+
* version 1.3 removes the <code>run()</code> function - please call <code>tasker.loop()</code> in your Arduino <code>loop()</code> function instead. This makes **Tasker** much more Arduino friendly and compatible with far more platforms where the Arduino 'kernel' does some housekeeping behind the scenes and needs the <code>loop()</code> to be running for it. It also allowed me to remove the <code>yield()</code> call that didn't really bring anything but issues in compiling on some platforms.
34
36
35
37
* version 1.2 adds optional priorities when defining tasks
36
38
37
-
* version 1.3 removes the <code>run()</code> function - please call <code>tasker.loop()</code> in your Arduino <code>loop()</code> function instead. This makes **Tasker** much more Arduino friendly and compatible with far more platforms where the Arduino 'kernel' does some housekeeping behind the scenes and needs the <code>loop()</code> to be running for it. It also allowed me to remove the <code>yield()</code> call that didn't really bring anything but issues in compiling on some platforms.
39
+
* version 1.1 adds clear example of DS18B20 handling
38
40
39
41
40
42
How to use
@@ -49,13 +51,13 @@ Tasker API
49
51
----------
50
52
51
53
* <code>Tasker([bool prioritized])</code>. The class constructor takes
52
-
an optional bool flag (that is set to true if omitted). If this flag
54
+
an optional bool flag (that is set to false if omitted). If this flag
53
55
is TRUE then the Tasker prioritizes the scheduled tasks. If the flag
54
56
is FALSE then the Tasker considers all scheduled tasks equal. More about priorities later.
tasker.setInterval(most_important_fn, ..); // formerly added calls have automatically higher priority
98
+
tasker.setInterval(less_important_fn, ..); // the later added calls the lower priority they have
99
+
tasker.setInterval(highest_priority_fn, .., .., 0); // unless you specify the priority explicitly by the last parameter
98
100
```
99
101
100
102
Normally, when there is enough time for calling each of the scheduled task
101
103
at the right time the priorities don't play any role but when a previous task takes
102
104
longer time and the scheduler detects that certain tasks are delayed
103
-
(are behind their schedule) it needs to decide which task will get run of those
105
+
(are behind their schedule) it needs to decide which task will be run of those
104
106
that should have been run already. And that's where the tasks' priorities step
105
107
in: the task added earlier or with a higher priority will be chosen.
106
-
If the priorities were disabled then the scheduler would simply run the next task
107
-
in its queue. If all your tasks are equally important you might want to disable
108
-
the priorities by passing FALSE into the constructor:
108
+
If the priorities were disabled (by default the are) then the scheduler would simply run the next task
109
+
in its queue. If all your tasks are equally important (they most probably are) you might simply ignore the whole idea of priorities and their implementation.
0 commit comments