34 if (existing.mImpl ==
t.mImpl) {
35 return existing._id();
68 for (fl::size i = 0; i <
mTasks.size();) {
71 if (!
t.is_valid() ||
t._is_canceled()) {
77 bool should_run =
t._ready_to_run(current_time);
81 t._set_last_run_time(current_time);
138 if (
task._type() == task_type &&
139 task._ready_to_run_frame_task(current_time)) {
149 if (!
task.is_valid() ||
task._is_canceled()) {
153 task._set_last_run_time(current_time);
154 if (
task._has_then()) {
155 task._execute_then();
166 for (fl::size i = 0; i <
mTasks.size();) {
167 if (!
mTasks[i].is_valid() ||
mTasks[i]._is_canceled()) {
183 if (
task.is_valid() && !
task._is_canceled() && is_frame_task) {
193 if (!trace_label.empty()) {
194 FL_WARN(
"[fl::task] Warning: no then() callback set for Task#" << task_id <<
" launched at " << trace_label);
196 FL_WARN(
"[fl::task] Warning: no then() callback set for Task#" << task_id);
203 if (!trace_label.empty()) {
204 FL_WARN(
"[fl::task] Warning: no catch_() callback set for Task#" << task_id <<
" launched at " << trace_label <<
". Error: " << error.message);
206 FL_WARN(
"[fl/task] Warning: no catch_() callback set for Task#" << task_id <<
". Error: " << error.message);
FastLED chrono implementation - duration types for time measurements.
static void setFrameTaskListener(Listener *listener) FL_NO_EXCEPT
static T & instance() FL_NO_EXCEPT
Task Handle with fluent API (was class fl::task, renamed to avoid namespace collision)
~Scheduler() FL_NO_EXCEPT override
void clear_all_tasks() FL_NO_EXCEPT
fl::vector< Handle > mTasks
fl::atomic< int > mNextTaskId
void warn_no_then(int task_id, const fl::string &trace_label) FL_NO_EXCEPT
bool mUpdatingAfterFrameTasks
bool mFrameListenerRegistered
static Scheduler & instance() FL_NO_EXCEPT
void warn_no_catch(int task_id, const fl::string &trace_label, const Error &error) FL_NO_EXCEPT
fl::vector< Handle > mAfterFrameSnapshot
bool mUpdatingBeforeFrameTasks
int add_task(Handle t) FL_NO_EXCEPT
void update_after_frame_tasks() FL_NO_EXCEPT
void onEndFrame() FL_NO_EXCEPT override
void remove_inactive_tasks() FL_NO_EXCEPT
void update_frame_listener_registration() FL_NO_EXCEPT
void update() FL_NO_EXCEPT
fl::vector< Handle > mBeforeFrameSnapshot
void update_before_frame_tasks() FL_NO_EXCEPT
void onBeginFrame() FL_NO_EXCEPT override
void update_tasks_of_type(TaskType task_type) FL_NO_EXCEPT
void clear() FL_NO_EXCEPT
void push_back(const T &value) FL_NO_EXCEPT
Centralized logging categories for FastLED hardware interfaces and subsystems.
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
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.
u8 u8 fract8 blur_amount FL_NO_EXCEPT
fl::u32 millis() FL_NO_EXCEPT
Universal millisecond timer - returns milliseconds since system startup.
Base definition for an LED controller.
Task scheduler — manages timer and frame-based tasks.