[core] RAII guard for component loop phase (#15897)
This commit is contained in:
1 parent
f6bf6dc8e5
commit
c399cd2fa2
2 files changed
+29
-17
No files matched your search
@@ -95,16 +95,16 @@ void Application::setup() {
|
||||
// interrupts during setup. During setup we always run the component
|
||||
// phase (no loop_interval_ gate), so call both helpers unconditionally.
|
||||
this->scheduler_tick_(MillisInternal::get());
|
||||
this->before_component_phase_();
|
||||
{
|
||||
ComponentPhaseGuard phase_guard{*this};
|
||||
|
||||
for (uint32_t j = 0; j <= i; j++) {
|
||||
// Update loop_component_start_time_ right before calling each component
|
||||
this->loop_component_start_time_ = MillisInternal::get();
|
||||
this->components_[j]->call();
|
||||
this->feed_wdt();
|
||||
for (uint32_t j = 0; j <= i; j++) {
|
||||
// Update loop_component_start_time_ right before calling each component
|
||||
this->loop_component_start_time_ = MillisInternal::get();
|
||||
this->components_[j]->call();
|
||||
this->feed_wdt();
|
||||
}
|
||||
}
|
||||
|
||||
this->after_component_phase_();
|
||||
yield();
|
||||
} while (!component->can_proceed() && !component->is_failed());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user