From 422147c370685d85cc5b2a73d2941ea0dd39adec Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 15 Mar 2026 18:10:14 -1000 Subject: [PATCH] bot comments --- esphome/core/component.cpp | 3 ++- esphome/core/component.h | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/esphome/core/component.cpp b/esphome/core/component.cpp index 60828eb1fe..10ee2eba5e 100644 --- a/esphome/core/component.cpp +++ b/esphome/core/component.cpp @@ -509,7 +509,8 @@ void PollingComponent::stop_poller() { uint32_t PollingComponent::get_update_interval() const { return this->update_interval_; } void PollingComponent::set_update_interval(uint32_t update_interval) { this->update_interval_ = update_interval; } -void __attribute__((noinline, cold)) warn_blocking(Component *component, uint32_t blocking_time) { +void __attribute__((noinline, cold)) +WarnIfComponentBlockingGuard::warn_blocking_(Component *component, uint32_t blocking_time) { bool should_warn; if (component != nullptr) { should_warn = component->should_warn_of_blocking(blocking_time); diff --git a/esphome/core/component.h b/esphome/core/component.h index 20a6d2311d..45531634f4 100644 --- a/esphome/core/component.h +++ b/esphome/core/component.h @@ -577,9 +577,6 @@ class PollingComponent : public Component { // millis() and micros() are available via hal.h -// Cold path for blocking warning - defined in component.cpp -void warn_blocking(Component *component, uint32_t blocking_time); - class WarnIfComponentBlockingGuard { public: WarnIfComponentBlockingGuard(Component *component, uint32_t start_time) @@ -601,7 +598,7 @@ class WarnIfComponentBlockingGuard { this->record_runtime_stats_(); #endif if (blocking_time > WARN_IF_BLOCKING_OVER_MS) [[unlikely]] { - warn_blocking(this->component_, blocking_time); + warn_blocking_(this->component_, blocking_time); } return curr_time; } @@ -615,6 +612,10 @@ class WarnIfComponentBlockingGuard { uint32_t started_us_; void record_runtime_stats_(); #endif + + private: + // Cold path for blocking warning - defined in component.cpp + static void __attribute__((noinline, cold)) warn_blocking_(Component *component, uint32_t blocking_time); }; // Function to clear setup priority overrides after all components are set up