mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
bot comments
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user