[core] Ensure SETUP→LOOP transition before main loop

Components after the last blocking component in setup only receive
one call() (CONSTRUCTION→SETUP) and never get the second call()
that would transition them to LOOP state. Explicitly transition all
active looping components to LOOP state at the end of setup() so
the main loop can call loop() directly without the call() state
machine wrapper.
This commit is contained in:
J. Nick Koston
2026-03-03 22:31:04 -10:00
parent 36a598fa40
commit fe0436166c
+8
View File
@@ -153,6 +153,14 @@ void Application::setup() {
this->setup_wake_loop_threadsafe_();
#endif
// Ensure all active looping components are in LOOP state.
// Components after the last blocking component only got one call() during setup
// (CONSTRUCTION→SETUP) and never received the second call() (SETUP→LOOP).
// The main loop calls loop() directly, bypassing call()'s state machine.
for (uint16_t i = 0; i < this->looping_components_active_end_; i++) {
this->looping_components_[i]->set_component_state_(COMPONENT_STATE_LOOP);
}
this->schedule_dump_config();
}
void Application::loop() {