FastLED 3.9.15
Loading...
Searching...
No Matches

◆ update_tasks_of_type()

void fl::task::Scheduler::update_tasks_of_type ( TaskType task_type)
private

Definition at line 74 of file scheduler.cpp.hpp.

74 {
75 u32 current_time = fl::millis();
76
77 // Use index-based iteration to avoid iterator invalidation issues
78 for (fl::size i = 0; i < mTasks.size();) {
79 Handle& t = mTasks[i];
80
81 if (!t.is_valid() || t._is_canceled()) {
82 // erase() returns bool in fl::vector, not iterator
83 mTasks.erase(mTasks.begin() + i);
84 // Don't increment i since we just removed an element
85 } else if (t._type() == task_type) {
86 // This is a frame task of the type we're looking for
87 bool should_run = t._ready_to_run_frame_task(current_time);
88
89 if (should_run) {
90 // Update last run time for frame tasks (though they don't use it)
91 t._set_last_run_time(current_time);
92
93 // Execute the task
94 if (t._has_then()) {
95 t._execute_then();
96 } else {
97 warn_no_then(t._id(), t._trace_label());
98 }
99
100 // Frame tasks are always one-shot, so remove them after execution
101 mTasks.erase(mTasks.begin() + i);
102 // Don't increment i since we just removed an element
103 } else {
104 ++i;
105 }
106 } else {
107 ++i; // Not the task type we're looking for
108 }
109 }
110}
void warn_no_then(int task_id, const fl::string &trace_label)
fl::vector< Handle > mTasks
Definition scheduler.h:39
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.

References fl::millis(), mTasks, fl::t, and warn_no_then().

Referenced by update_after_frame_tasks(), and update_before_frame_tasks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: