Go to the documentation of this file.
110 void sleep(
unsigned interval)
118 auto task =
static_cast<Task*
>(param);
137 virtual void loop() = 0;
168 auto task =
reinterpret_cast<Task*
>(param);
169 task->scheduled =
false;
184 notify(notification);
194 bool scheduled{
false};
State
State of a task.
Definition: Core/Task.h:58
bool startOnce()
Start one-shot timer.
Definition: CallbackTimer.h:227
CallbackTimer & initializeMs(TimerCallback callback, void *arg=nullptr)
Initialise hardware timer in milliseconds (static check) with Timer Callback and optional argument.
Definition: CallbackTimer.h:181
void suspend()
Suspend a task.
Definition: Core/Task.h:106
void sleep(unsigned interval)
Puts the task to sleep for a while.
Definition: Core/Task.h:129
bool resume()
Call to set task running.
Definition: Core/Task.h:83
virtual void loop()=0
Inherited classes override this to perform actual work.
virtual ~Task()
Definition: Core/Task.h:75
SystemClass System
Global instance of system object.
Class to support running a background task.
Definition: Core/Task.h:33
static bool queueCallback(TaskCallback32 callback, uint32_t param=0)
Queue a deferred callback.
virtual void onNotify(Notify code)
Called immediately before calling to loop() to indicate a state change.
Definition: Core/Task.h:161
Notify
Notification of state change.
Definition: Core/Task.h:67
void stop()
Stops timer.
Definition: CallbackTimer.h:234