Add minor NULL and double-free checks to source, identified using GCC10
pre-release static `-fanalyzer` on the coude. These are harmless to
other versions.
Also add explicit include of stdint to Schedule.h, because libstdc++20
will not automatically include it. Safe and no-op on earlier versions.
* Fix for scheduling recurrent functions while inside scheduled function
* Check that fn are valid. Invoking invalid functions throws otherwise.
* Added wakeup token to scheduler. Toggling the token value breaks a scheduled function
out from a delayed execution and makes it run on the next scheduler iteration.
* Timer reset reliability fix.
* Shrink interrupts-locked regions.
Add check for periodic yield to scheduled functions run-loop.
* Ordered, more predictable, scheduling. Before, it had different ordering compared to
FastScheduler as well as sequential calls from loop().
* Optional, for the paranoid: revert changes to (non-recurrent) schedule_function() / run_scheduled_functions().
* Comment
* Adapt one-line ifs to general style in same source file.
* Fix wakeupToken handling - don't respond to toggle, but to different value
vs. that at registering function with scheduler.
* Reword comment.
* Putting aside std::atomic concerns, use a callback for scheduler alarming.
In the future, async future's .then() might take advantage of this direction.
* Drop atomic include, align function type syntax.
* Reduce flash use.
* Prefer const ref over call by value plus std::move().
* add regular scheduled functions, now also callable on `yield()`
added bool schedule_function_us(std::function<bool(void)> fn, uint32_t repeat_us)
lambda must return true to be not removed from the schedule function list
if repeat_us is 0, then the function is called only once.
Legacy schedule_function() is preserved
This addition allows network drivers like ethernet chips on lwIP to be regularly called
- even if some user code loops on receiving data without getting out from main loop
(callable from yield())
- without the need to call the driver handling function
(transparent)
This may be also applicable with common libraries (mDNS, Webserver, )