int interval_ms() const FL_NO_EXCEPT
Returns the interval between runs, in milliseconds.
void set_last_run_time(u32 time) FL_NO_EXCEPT
Records the timestamp of the most recent run.
u32 last_run_time() const FL_NO_EXCEPT
Returns the timestamp of the most recent run, in milliseconds.
Handle & then(function< void()> on_then) FL_NO_EXCEPT
Sets the callback invoked when the task runs successfully.
bool has_then() const FL_NO_EXCEPT
Returns whether a success callback is configured.
bool _has_then() const FL_NO_EXCEPT
int _id() const FL_NO_EXCEPT
void _execute_catch(const Error &error) FL_NO_EXCEPT
void _execute_then() FL_NO_EXCEPT
Handle & catch_(function< void(const Error &)> on_catch) FL_NO_EXCEPT
Sets the callback invoked when task execution reports an error.
bool _is_canceled() const FL_NO_EXCEPT
void stop() FL_NO_EXCEPT
Stops the coroutine represented by this handle.
bool _ready_to_run(u32 current_time) const FL_NO_EXCEPT
Handle & cancel() FL_NO_EXCEPT
Prevents future scheduled executions of the task.
void set_interval_ms(int interval_ms) FL_NO_EXCEPT
Changes the interval between runs.
bool is_valid() const FL_NO_EXCEPT
Returns whether this handle refers to a task.
bool isRunning() const FL_NO_EXCEPT
Returns whether the represented coroutine is currently running.
bool has_catch() const FL_NO_EXCEPT
Returns whether an error callback is configured.
bool isCoroutine() const FL_NO_EXCEPT
Returns whether this handle refers to an OS-level coroutine.
TaskType _type() const FL_NO_EXCEPT
Handle() FL_NO_EXCEPT=default
Constructs an empty, invalid handle.
string _trace_label() const FL_NO_EXCEPT
bool ready_to_run(u32 current_time) const FL_NO_EXCEPT
Tests whether the task is ready at a given timestamp.
bool _ready_to_run_frame_task(u32 current_time) const FL_NO_EXCEPT
void _set_last_run_time(u32 time) FL_NO_EXCEPT
string trace_label() const FL_NO_EXCEPT
Returns the label of the task's creation trace, if available.
void _set_id(int id) FL_NO_EXCEPT
shared_ptr< ITaskImpl > mImpl
TaskType type() const FL_NO_EXCEPT
Returns the task's scheduling mode.
Handle before_frame()
Frame tasks recur: every overload below schedules a task that runs once per FastLED frame and keeps d...
Handle after_frame()
Creates a task that runs after every FastLED frame until canceled.
Handle coroutine(const CoroutineConfig &config)
Creates and starts an OS-level coroutine task.
Handle at_framerate(int fps)
Creates a task that runs at a fixed frame rate.
Handle every_ms(int interval_ms)
Creates a task that runs at a fixed millisecond interval.
TaskType
Identifies how a scheduled task is triggered.
@ kBeforeFrame
Runs immediately before each FastLED frame is rendered.
@ kAfterFrame
Runs immediately after each FastLED frame is rendered.
@ kAtFramerate
Runs at a fixed number of times per second.
@ kEveryMs
Runs after a fixed time interval.
@ kCoroutine
Runs as an operating-system or RTOS task.
void exit_current()
Terminates the currently executing coroutine.
function< void()> func
Function executed by the coroutine, copied at creation time.
u8 priority
Platform task priority relative to the platform idle priority, default 5.
size_t stack_size
Requested stack size in bytes, default 4096.
optional< TracePoint > trace
Optional location where the task was created, reported by Handle::trace_label().
optional< int > core_id
Optional CPU core affinity, unset by default (no affinity).
string name
Diagnostic name reported by the platform. Defaults to "task".
Function and platform tuning for an OS-level coroutine task.
fl::u64 time() FL_NO_EXCEPT
Alias for millis64() - returns 64-bit millisecond time.
InputGamut g FL_NO_EXCEPT
fl::tuple< const char *, int, fl::u32 > TracePoint
A structure to hold source trace information.
Base definition for an LED controller.
Promise-based fluent API for FastLED - standalone async primitives.