mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
Merge remote-tracking branch 'origin/decouple_scheduler_loop_cadence' into integration
This commit is contained in:
@@ -41,7 +41,7 @@ class RuntimeStatsCollector {
|
||||
// active_us = total time between loop start and just before yield.
|
||||
// before_us = time spent in Phase A (scheduler tick) excluding time
|
||||
// already attributed to per-component stats.
|
||||
// tail_us = time spent in after_loop_tasks_ + the trailing record/stats
|
||||
// tail_us = time spent in after_component_phase_ + the trailing record/stats
|
||||
// prefix. On Phase A-only ticks (component phase gated) this
|
||||
// is just the small trailing prefix between loop_before_end_us
|
||||
// and loop_now_us — non-zero but typically a few µs.
|
||||
|
||||
@@ -106,7 +106,7 @@ void Application::setup() {
|
||||
this->feed_wdt();
|
||||
}
|
||||
|
||||
this->after_loop_tasks_();
|
||||
this->after_component_phase_();
|
||||
yield();
|
||||
} while (!component->can_proceed() && !component->is_failed());
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ class Application {
|
||||
void activate_looping_component_(uint16_t index);
|
||||
inline uint32_t ESPHOME_ALWAYS_INLINE scheduler_tick_(uint32_t now);
|
||||
inline void ESPHOME_ALWAYS_INLINE before_component_phase_();
|
||||
inline void ESPHOME_ALWAYS_INLINE after_loop_tasks_() { this->in_loop_ = false; }
|
||||
inline void ESPHOME_ALWAYS_INLINE after_component_phase_() { this->in_loop_ = false; }
|
||||
|
||||
/// Process dump_config output one component per loop iteration.
|
||||
/// Extracted from loop() to keep cold startup/reconnect logging out of the hot path.
|
||||
@@ -695,10 +695,9 @@ inline void ESPHOME_ALWAYS_INLINE __attribute__((optimize("O2"))) Application::l
|
||||
#ifdef USE_RUNTIME_STATS
|
||||
loop_tail_start_us = micros();
|
||||
#endif
|
||||
this->after_loop_tasks_();
|
||||
|
||||
this->last_loop_ = last_op_end_time;
|
||||
now = last_op_end_time;
|
||||
this->after_component_phase_();
|
||||
}
|
||||
|
||||
#ifdef USE_RUNTIME_STATS
|
||||
|
||||
Reference in New Issue
Block a user