-
-
Notifications
You must be signed in to change notification settings - Fork 34
Task Manager API
The TaskManager will manage the running tasks and allow you to start and stop tasks as you need.
This will initialize the TaskManager and prepare it for use. Call this first within Setup().
This will allow the taskmanager to schedule tasks for work and call them to do work. This should be called in the loop()
of the sketch and often should now be the only thing called in it.
This will start given task. The tasks OnStart()
method will be called. After this the OnUpdate()
will periodically be called.
This will stop the given task. The tasks OnStop()
method will be called. After this the OnUpdate()
will no longer be called.
This will stop the given task and then restart it. This is an easy way to keep an "idle" timer running.
This will enter sleep mode for the AVR boards. See [Sleep Mode for AVR]{https://github.com/Makuna/Task/wiki/Sleep-Mode-for-AVR} for more details.
(Esp8266) void EnterSleep(uint32_t microSeconds, void* state = NULL, uint16_t sizeofState = 0, WakeMode mode = WAKE_RF_DEFAULT);
This will enter sleep mode for the Esp8266 boards. See Sleep Mode for Esp8266 for more details.
This will check if the sketch was started due to being awaken for the Esp8266 boards. See Sleep Mode for Esp8266 for more details.
Return the current time when the last Loop()
was called.
Normally you might call millis()
or micros()
to get the current time. But this returns the value exactly when you call it; so often you might call it once and cache the value to use for multiple checks latter down in the code. This method can replace that as the time returned is the already cached time. See Task Time for more details.