mirror of
https://github.com/esphome/esphome.git
synced 2026-09-12 07:47:33 +00:00
Merge remote-tracking branch 'origin/inline-finish-guard' into integration
This commit is contained in:
@@ -523,7 +523,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);
|
||||
|
||||
@@ -578,9 +578,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)
|
||||
@@ -602,7 +599,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;
|
||||
}
|
||||
@@ -616,6 +613,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