Fix timing overflow when components disable themselves during loop

This commit is contained in:
J. Nick Koston 2025-07-15 11:03:56 -10:00
parent 0968338064
commit 78a0fecc08
No known key found for this signature in database

View File

@ -309,6 +309,9 @@ void Application::disable_component_loop_(Component *component) {
if (this->in_loop_ && i == this->current_loop_index_) { if (this->in_loop_ && i == this->current_loop_index_) {
// Decrement so we'll process the swapped component next // Decrement so we'll process the swapped component next
this->current_loop_index_--; this->current_loop_index_--;
// Update the loop start time to current time so the swapped component
// gets correct timing instead of inheriting stale timing
this->loop_component_start_time_ = millis();
} }
} }
return; return;