ESPHome 2026.7.1
Loading...
Searching...
No Matches
component.cpp
Go to the documentation of this file.
2
3#include <cinttypes>
4#include <limits>
5#include <memory>
6#include <utility>
7#include <vector>
9#include "esphome/core/hal.h"
11#include "esphome/core/log.h"
12
13namespace esphome {
14
15static const char *const TAG = "component";
16
17// Global vectors for component data that doesn't belong in every instance.
18// Using vector instead of unordered_map for both because:
19// - Much lower memory overhead (8 bytes per entry vs 20+ for unordered_map)
20// - Linear search is fine for small n (typically < 5 entries)
21// - These are rarely accessed (setup only or error cases only)
22
23// Component error messages - only stores messages for failed components
24// Lazy allocated since most configs have zero failures
25// Note: We don't clear this vector because:
26// 1. Components are never destroyed in ESPHome
27// 2. Failed components remain failed (no recovery mechanism)
28// 3. Memory usage is minimal (only failures with custom messages are stored)
29
30// Using namespace-scope static to avoid guard variables (saves 16 bytes total)
31// This is safe because ESPHome is single-threaded during initialization
32namespace {
33struct ComponentErrorMessage {
34 const Component *component;
35 const LogString *message;
36};
37
38#ifdef USE_SETUP_PRIORITY_OVERRIDE
39struct ComponentPriorityOverride {
40 const Component *component;
41 float priority;
42};
43
44// Setup priority overrides - freed after setup completes
45// Using raw pointer instead of unique_ptr to avoid global constructor/destructor overhead
46// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
47std::vector<ComponentPriorityOverride> *setup_priority_overrides = nullptr;
48#endif
49
50// Error messages for failed components
51// Using raw pointer instead of unique_ptr to avoid global constructor/destructor overhead
52// This is never freed as error messages persist for the lifetime of the device
53// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
54std::vector<ComponentErrorMessage> *component_error_messages = nullptr;
55
56// Helper to store error messages
57void store_component_error_message(const Component *component, const LogString *message) {
58 // Lazy allocate the error messages vector if needed
59 if (!component_error_messages) {
60 component_error_messages = new std::vector<ComponentErrorMessage>();
61 }
62 // Check if this component already has an error message
63 for (auto &entry : *component_error_messages) {
64 if (entry.component == component) {
65 entry.message = message;
66 return;
67 }
68 }
69 // Add new error message
70 component_error_messages->emplace_back(ComponentErrorMessage{component, message});
71}
72} // namespace
73
74// setup_priority, component state, and status LED constants are now
75// constexpr in component.h
76
77static constexpr uint16_t WARN_IF_BLOCKING_INCREMENT_MS =
78 10U;
79// Threshold in ms (computed from centiseconds constant in component.h)
80static constexpr uint32_t WARN_IF_BLOCKING_OVER_MS = static_cast<uint32_t>(WARN_IF_BLOCKING_OVER_CS) * 10U;
81
83
85
87
88void Component::set_interval(const char *name, uint32_t interval, std::function<void()> &&f) { // NOLINT
89 App.scheduler.set_interval(this, name, interval, std::move(f));
90}
91
92bool Component::cancel_interval(const char *name) { // NOLINT
93 return App.scheduler.cancel_interval(this, name);
94}
95
96void Component::set_retry(const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts,
97 std::function<RetryResult(uint8_t)> &&f, float backoff_increase_factor) { // NOLINT
98#pragma GCC diagnostic push
99#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
100 App.scheduler.set_retry(this, name, initial_wait_time, max_attempts, std::move(f), backoff_increase_factor);
101#pragma GCC diagnostic pop
102}
103
104void Component::set_retry(const char *name, uint32_t initial_wait_time, uint8_t max_attempts,
105 std::function<RetryResult(uint8_t)> &&f, float backoff_increase_factor) { // NOLINT
106#pragma GCC diagnostic push
107#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
108 App.scheduler.set_retry(this, name, initial_wait_time, max_attempts, std::move(f), backoff_increase_factor);
109#pragma GCC diagnostic pop
110}
111
112bool Component::cancel_retry(const std::string &name) { // NOLINT
113#pragma GCC diagnostic push
114#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
115 return App.scheduler.cancel_retry(this, name);
116#pragma GCC diagnostic pop
117}
118
119bool Component::cancel_retry(const char *name) { // NOLINT
120#pragma GCC diagnostic push
121#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
122 return App.scheduler.cancel_retry(this, name);
123#pragma GCC diagnostic pop
124}
125
126void Component::set_timeout(const char *name, uint32_t timeout, std::function<void()> &&f) { // NOLINT
127 App.scheduler.set_timeout(this, name, timeout, std::move(f));
128}
129
130bool Component::cancel_timeout(const char *name) { // NOLINT
131 return App.scheduler.cancel_timeout(this, name);
132}
133
134// uint32_t (numeric ID) overloads - zero heap allocation
135void Component::set_timeout(uint32_t id, uint32_t timeout, std::function<void()> &&f) { // NOLINT
136 App.scheduler.set_timeout(this, id, timeout, std::move(f));
137}
138
139bool Component::cancel_timeout(uint32_t id) { return App.scheduler.cancel_timeout(this, id); }
140
141void Component::set_timeout(InternalSchedulerID id, uint32_t timeout, std::function<void()> &&f) { // NOLINT
142 App.scheduler.set_timeout(this, id, timeout, std::move(f));
143}
144
145bool Component::cancel_timeout(InternalSchedulerID id) { return App.scheduler.cancel_timeout(this, id); }
146
147void Component::set_interval(uint32_t id, uint32_t interval, std::function<void()> &&f) { // NOLINT
148 App.scheduler.set_interval(this, id, interval, std::move(f));
149}
150
151bool Component::cancel_interval(uint32_t id) { return App.scheduler.cancel_interval(this, id); }
152
153void Component::set_interval(InternalSchedulerID id, uint32_t interval, std::function<void()> &&f) { // NOLINT
154 App.scheduler.set_interval(this, id, interval, std::move(f));
155}
156
157bool Component::cancel_interval(InternalSchedulerID id) { return App.scheduler.cancel_interval(this, id); }
158
159void Component::set_retry(uint32_t id, uint32_t initial_wait_time, uint8_t max_attempts,
160 std::function<RetryResult(uint8_t)> &&f, float backoff_increase_factor) { // NOLINT
161#pragma GCC diagnostic push
162#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
163 App.scheduler.set_retry(this, id, initial_wait_time, max_attempts, std::move(f), backoff_increase_factor);
164#pragma GCC diagnostic pop
165}
166
167bool Component::cancel_retry(uint32_t id) {
168#pragma GCC diagnostic push
169#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
170 return App.scheduler.cancel_retry(this, id);
171#pragma GCC diagnostic pop
172}
173
174void Component::call_setup() { this->setup(); }
176 this->dump_config();
177 if (this->is_failed()) {
178 // Look up error message from global vector
179 const LogString *error_msg = nullptr;
180 if (component_error_messages) {
181 for (const auto &entry : *component_error_messages) {
182 if (entry.component == this) {
183 error_msg = entry.message;
184 break;
185 }
186 }
187 }
188 ESP_LOGE(TAG, " %s is marked FAILED: %s", LOG_STR_ARG(this->get_component_log_str()),
189 error_msg ? LOG_STR_ARG(error_msg) : LOG_STR_LITERAL("unspecified"));
190 }
191}
192
195 switch (state) {
197 // State Construction: Call setup and set state to setup
199 ESP_LOGV(TAG, "Setup %s", LOG_STR_ARG(this->get_component_log_str()));
200#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_DEBUG
201 uint32_t start_time = millis();
202#endif
203 this->call_setup();
204#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_DEBUG
205 uint32_t setup_time = millis() - start_time;
206 // Only log at CONFIG level if setup took longer than the blocking threshold
207 // to avoid spamming the log and blocking the event loop
208 if (setup_time >= WARN_IF_BLOCKING_OVER_MS) {
209 ESP_LOGCONFIG(TAG, "Setup %s took %ums", LOG_STR_ARG(this->get_component_log_str()), (unsigned) setup_time);
210 } else {
211 ESP_LOGV(TAG, "Setup %s took %ums", LOG_STR_ARG(this->get_component_log_str()), (unsigned) setup_time);
212 }
213#endif
214 break;
215 }
217 // State setup: Call first loop and set state to loop
219 this->loop();
220 break;
222 // State loop: Call loop
223 this->loop();
224 break;
226 // State failed: Do nothing
228 // State loop done: Do nothing, component has finished its work
229 default:
230 break;
231 }
232}
233bool Component::should_warn_of_blocking(uint32_t blocking_time, uint32_t &threshold_ms_out) {
234 // Convert centisecond threshold to milliseconds for comparison
235 uint32_t threshold_ms = static_cast<uint32_t>(this->warn_if_blocking_over_) * 10U;
236 // Report the threshold that was exceeded (before any ratcheting below) so the warning is accurate.
237 threshold_ms_out = threshold_ms;
238 if (blocking_time > threshold_ms) {
239 // Set new threshold: blocking_time + increment, converted back to centiseconds
240 uint32_t new_threshold_ms = blocking_time + WARN_IF_BLOCKING_INCREMENT_MS;
241 uint32_t new_cs = new_threshold_ms / 10U;
242 // Saturate at uint8_t max (255 = 2550ms)
243 this->warn_if_blocking_over_ = static_cast<uint8_t>(new_cs > 255U ? 255U : new_cs);
244 return true;
245 }
246 return false;
247}
249 ESP_LOGE(TAG, "%s was marked as failed", LOG_STR_ARG(this->get_component_log_str()));
251 this->status_set_error();
252 // Also remove from loop since failed components shouldn't loop
254}
257 ESP_LOGVV(TAG, "%s loop disabled", LOG_STR_ARG(this->get_component_log_str()));
260 }
261}
263 ESP_LOGVV(TAG, "%s loop enabled", LOG_STR_ARG(this->get_component_log_str()));
266}
268 // This method is thread and ISR-safe because:
269 // 1. Only performs simple assignments to volatile variables (atomic on all platforms)
270 // 2. No read-modify-write operations that could be interrupted
271 // 3. No memory allocation or object construction; on ESP32 the only call (wake_loop_any_context) is ISR-safe
272 // 4. IRAM_ATTR ensures code is in IRAM, not flash (required for ISR execution)
273 // 5. Components are never destroyed, so no use-after-free concerns
274 // 6. App is guaranteed to be initialized before any ISR could fire
275 // 7. Multiple ISR/thread calls are safe - just sets the same flags to true
276 // 8. Race condition with main loop is handled by clearing flag before processing
277 this->pending_enable_loop_ = true;
279 // Wake the main loop from sleep. Without this, the main loop would not
280 // wake until the select/delay timeout expires (~16ms).
282}
285 ESP_LOGI(TAG, "%s is being reset to construction state", LOG_STR_ARG(this->get_component_log_str()));
287 // Clear error status when resetting
288 this->status_clear_error();
289 }
290}
291void Component::defer(std::function<void()> &&f) { // NOLINT
292 App.scheduler.set_timeout(this, static_cast<const char *>(nullptr), 0, std::move(f));
293}
294bool Component::cancel_defer(const char *name) { // NOLINT
295 return App.scheduler.cancel_timeout(this, name);
296}
297void Component::defer(const char *name, std::function<void()> &&f) { // NOLINT
298 App.scheduler.set_timeout(this, name, 0, std::move(f));
299}
300void Component::defer(uint32_t id, std::function<void()> &&f) { // NOLINT
301 App.scheduler.set_timeout(this, id, 0, std::move(f));
302}
303bool Component::cancel_defer(uint32_t id) { return App.scheduler.cancel_timeout(this, id); }
304void Component::set_timeout(uint32_t timeout, std::function<void()> &&f) { // NOLINT
305 App.scheduler.set_timeout(this, static_cast<const char *>(nullptr), timeout, std::move(f));
306}
307void Component::set_interval(uint32_t interval, std::function<void()> &&f) { // NOLINT
308 App.scheduler.set_interval(this, static_cast<const char *>(nullptr), interval, std::move(f));
309}
310void Component::set_retry(uint32_t initial_wait_time, uint8_t max_attempts, std::function<RetryResult(uint8_t)> &&f,
311 float backoff_increase_factor) { // NOLINT
312#pragma GCC diagnostic push
313#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
314 App.scheduler.set_retry(this, "", initial_wait_time, max_attempts, std::move(f), backoff_increase_factor);
315#pragma GCC diagnostic pop
316}
318 // Bitmask check: valid states are SETUP(1), LOOP(2), LOOP_DONE(4)
319 // (1 << state) & 0b10110 checks membership in one instruction
320 return ((1u << (this->component_state_ & COMPONENT_STATE_MASK)) &
321 ((1u << COMPONENT_STATE_SETUP) | (1u << COMPONENT_STATE_LOOP) | (1u << COMPONENT_STATE_LOOP_DONE))) != 0;
322}
323bool Component::can_proceed() { return true; }
324bool Component::set_status_flag_(uint8_t flag) {
325 if ((this->component_state_ & flag) != 0)
326 return false;
327 this->component_state_ |= flag;
328 App.app_state_ |= flag;
329 return true;
330}
331
332void Component::status_set_warning() { this->status_set_warning((const LogString *) nullptr); }
335 return;
336 ESP_LOGW(TAG, "%s set Warning flag: %s", LOG_STR_ARG(this->get_component_log_str()),
337 message ? message : LOG_STR_LITERAL("unspecified"));
338}
341 return;
342 ESP_LOGW(TAG, "%s set Warning flag: %s", LOG_STR_ARG(this->get_component_log_str()),
343 message ? LOG_STR_ARG(message) : LOG_STR_LITERAL("unspecified"));
344}
345void Component::status_set_error() { this->status_set_error((const LogString *) nullptr); }
346void Component::status_set_error(const LogString *message) {
348 return;
349 ESP_LOGE(TAG, "%s set Error flag: %s", LOG_STR_ARG(this->get_component_log_str()),
350 message ? LOG_STR_ARG(message) : LOG_STR_LITERAL("unspecified"));
351 if (message != nullptr) {
352 store_component_error_message(this, message);
353 }
354}
356 this->component_state_ &= ~STATUS_LED_WARNING;
357 // Clear the app-wide STATUS_LED_WARNING bit only if setup has finished
358 // AND no other component still has it set. During setup the forced
359 // STATUS_LED_WARNING (from the slow-setup busy-wait) must not be wiped
360 // by a transient component clear — Application::setup() reconciles
361 // the warning bit once at the end before setting APP_STATE_SETUP_COMPLETE.
362 // The set path is unchanged (set_status_flag_ still writes directly).
364 App.app_state_ &= ~STATUS_LED_WARNING;
365 ESP_LOGW(TAG, "%s cleared Warning flag", LOG_STR_ARG(this->get_component_log_str()));
366}
368 this->component_state_ &= ~STATUS_LED_ERROR;
369 // STATUS_LED_ERROR is never artificially forced — it only ever lands
370 // in app_state_ via a real set_status_flag_ call. So the walk-and-clear
371 // path is always safe, including during setup.
373 App.app_state_ &= ~STATUS_LED_ERROR;
374 ESP_LOGE(TAG, "%s cleared Error flag", LOG_STR_ARG(this->get_component_log_str()));
375}
377 this->status_set_warning();
378 this->set_timeout(name, length, [this]() { this->status_clear_warning(); });
379}
381 this->status_set_error();
382 this->set_timeout(name, length, [this]() { this->status_clear_error(); });
383}
385
386// Function implementation of LOG_UPDATE_INTERVAL macro to reduce code size
388 uint32_t update_interval = component->get_update_interval();
389 if (update_interval == SCHEDULER_DONT_RUN) {
390 ESP_LOGCONFIG(tag, " Update Interval: never");
391 } else if (update_interval < 100) {
392 ESP_LOGCONFIG(tag, " Update Interval: %.3fs", update_interval / 1000.0f);
393 } else {
394 ESP_LOGCONFIG(tag, " Update Interval: %.1fs", update_interval / 1000.0f);
395 }
396}
398#ifdef USE_SETUP_PRIORITY_OVERRIDE
399 // Check if there's an override in the global vector
400 if (setup_priority_overrides) {
401 // Linear search is fine for small n (typically < 5 overrides)
402 for (const auto &entry : *setup_priority_overrides) {
403 if (entry.component == this) {
404 return entry.priority;
405 }
406 }
407 }
408#endif
409 return this->get_setup_priority();
410}
411#ifdef USE_SETUP_PRIORITY_OVERRIDE
413 // Lazy allocate the vector if needed
414 if (!setup_priority_overrides) {
415 setup_priority_overrides = new std::vector<ComponentPriorityOverride>();
416 }
417
418 // Check if this component already has an override
419 for (auto &entry : *setup_priority_overrides) {
420 if (entry.component == this) {
421 entry.priority = priority;
422 return;
423 }
424 }
425
426 // Add new override
427 setup_priority_overrides->emplace_back(ComponentPriorityOverride{this, priority});
428}
429#endif
430
431PollingComponent::PollingComponent(uint32_t update_interval) : update_interval_(update_interval) {}
432
434 // init the poller before calling setup, allowing setup to cancel it if desired
435 this->start_poller();
436 // Let the polling component subclass setup their HW.
437 this->setup();
438}
439
441 // Register interval.
442 this->set_interval(InternalSchedulerID::POLLING_UPDATE, this->get_update_interval(), [this]() { this->update(); });
443}
444
446 // Clear the interval to suspend component
448}
449
451
452#ifdef USE_RUNTIME_STATS
453uint64_t ComponentRuntimeStats::global_recorded_us = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
454#endif
455
456void __attribute__((noinline, cold)) LoopBlockingGuard::warn_blocking(uint32_t blocking_time) {
457 // Identity is published on App by the caller before the guard is built; read it back here.
459 // Component-less path always warns (the caller already checked the constant threshold).
460 uint32_t threshold_ms = WARN_IF_BLOCKING_OVER_MS;
461 if (component != nullptr && !component->should_warn_of_blocking(blocking_time, threshold_ms)) {
462 return; // Component's (possibly ratcheted) threshold not exceeded yet
463 }
464 // Component name if any, else the published source (owning script), else a generic label.
465 const LogString *name;
466 if (component != nullptr) {
467 name = component->get_component_log_str();
468 } else {
469 name = App.get_current_source();
470 if (name == nullptr)
471 name = LOG_STR("a scheduled task");
472 }
473 ESP_LOGW(TAG, "%s took a long time for an operation (%" PRIu32 " ms), max is %" PRIu32 " ms", LOG_STR_ARG(name),
474 blocking_time, threshold_ms);
475}
476
477#ifdef USE_SETUP_PRIORITY_OVERRIDE
479 // Free the setup priority map completely
480 delete setup_priority_overrides;
481 setup_priority_overrides = nullptr;
482}
483#endif
484
485// Weak default for component_source_lookup - overridden by generated code
486__attribute__((weak)) const LogString *component_source_lookup(uint8_t) { return LOG_STR("<unknown>"); }
487
488} // namespace esphome
Component * get_current_component()
bool any_component_has_status_flag_(uint8_t flag) const
Walk all registered components looking for any whose component_state_ has the given flag set.
void enable_component_loop_(Component *component)
void disable_component_loop_(Component *component)
const LogString * get_current_source()
volatile bool has_pending_enable_loop_requests_
bool is_setup_complete() const
True once Application::setup() has finished walking all components and finalized the initial status f...
void mark_failed()
Mark this component as failed.
void status_momentary_error(const char *name, uint32_t length=5000)
Set error status flag and automatically clear it after a timeout.
virtual float get_setup_priority() const
priority of setup().
Definition component.cpp:82
virtual void setup()
Where the component's initialization should happen.
Definition component.cpp:84
float get_actual_setup_priority() const
bool set_status_flag_(uint8_t flag)
Helper to set a status LED flag on both this component and the app.
bool is_failed() const
Definition component.h:274
void enable_loop_slow_path_()
volatile bool pending_enable_loop_
ISR-safe flag for enable_loop_soon_any_context.
Definition component.h:533
virtual bool can_proceed()
bool cancel_interval(const char *name)
Cancel an interval function.
Definition component.cpp:92
void status_clear_error()
Definition component.h:297
void enable_loop_soon_any_context()
Thread and ISR-safe version of enable_loop() that can be called from any context.
uint8_t component_state_
State of this component - each bit has a purpose: Bits 0-2: Component state (0x00=CONSTRUCTION,...
Definition component.h:532
bool should_warn_of_blocking(uint32_t blocking_time, uint32_t &threshold_ms_out)
bool cancel_timeout(const char *name)
Cancel a timeout function.
void status_momentary_warning(const char *name, uint32_t length=5000)
Set warning status flag and automatically clear it after a timeout.
bool is_ready() const
virtual void dump_config()
const LogString * get_component_log_str() const ESPHOME_ALWAYS_INLINE
Get the integration where this component was declared as a LogString for logging.
Definition component.h:327
void status_clear_warning_slow_path_()
void set_component_state_(uint8_t state)
Helper to set component state (clears state bits and sets new state)
Definition component.h:351
ESPDEPRECATED("set_retry is deprecated and will be removed in 2026.8.0. Use set_timeout or set_interval instead.", "2026.2.0") void set_retry(const std uint32_t uint8_t std::function< RetryResult(uint8_t)> float backoff_increase_factor
Definition component.h:424
void set_timeout(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a const char* name.
void defer(const char *name, std::function< void()> &&f)
Defer a callback to the next loop() call with a const char* name.
void status_clear_error_slow_path_()
void disable_loop()
Disable this component's loop.
void set_interval(const char *name, uint32_t interval, std::function< void()> &&f)
Set an interval function with a const char* name.
Definition component.cpp:88
ESPDEPRECATED("set_retry is deprecated and will be removed in 2026.8.0. Use set_timeout or set_interval instead.", "2026.2.0") void set_retry(const std uint32_t initial_wait_time
Definition component.h:423
virtual void loop()
This method will be called repeatedly.
Definition component.cpp:86
ESPDEPRECATED("set_retry is deprecated and will be removed in 2026.8.0. Use set_timeout or set_interval instead.", "2026.2.0") void set_retry(const std uint32_t uint8_t max_attempts
Definition component.h:423
void reset_to_construction_state()
Reset this component back to the construction state to allow setup to run again.
uint8_t warn_if_blocking_over_
Warn threshold in centiseconds (max 2550ms)
Definition component.h:525
void set_setup_priority(float priority)
bool cancel_defer(const char *name)
Cancel a defer callback using the specified name, name must not be empty.
ESPDEPRECATED("set_retry is deprecated and will be removed in 2026.8.0. Use set_timeout or set_interval instead.", "2026.2.0") void set_retry(const std uint32_t uint8_t std::function< RetryResult(uint8_t)> && f
Definition component.h:424
void status_clear_warning()
Definition component.h:291
virtual void call_setup()
This class simplifies creating components that periodically check a state.
Definition component.h:547
virtual uint32_t get_update_interval() const
Get the update interval in ms of this sensor.
void call_setup() override
virtual void update()=0
struct @65::@66 __attribute__
Wake the main loop task from an ISR. ISR-safe.
Definition main_task.h:32
const Component * component
Definition component.cpp:34
const LogString * message
Definition component.cpp:35
uint8_t priority
bool state
Definition fan.h:2
constexpr float DATA
For components that import data from directly connected sensors like DHT.
Definition component.h:45
const char *const TAG
Definition spi.cpp:7
const char * tag
Definition log.h:74
constexpr uint8_t COMPONENT_STATE_FAILED
Definition component.h:85
constexpr uint8_t WARN_IF_BLOCKING_OVER_CS
Definition component.h:102
InternalSchedulerID
Type-safe scheduler IDs for core base classes.
Definition component.h:68
constexpr uint8_t COMPONENT_STATE_LOOP
Definition component.h:84
constexpr uint8_t STATUS_LED_WARNING
Definition component.h:90
constexpr uint8_t COMPONENT_STATE_MASK
Definition component.h:81
void log_update_interval(const char *tag, PollingComponent *component)
void clear_setup_priority_overrides()
const LogString * component_source_lookup(uint8_t index)
Lookup component source name by index (1-based).
constexpr uint8_t COMPONENT_STATE_LOOP_DONE
Definition component.h:86
uint32_t IRAM_ATTR HOT millis()
Definition hal.cpp:28
Application App
Global storage of Application pointer - only one Application can exist.
constexpr uint8_t COMPONENT_STATE_SETUP
Definition component.h:83
constexpr uint8_t COMPONENT_STATE_CONSTRUCTION
Definition component.h:82
constexpr uint8_t STATUS_LED_ERROR
Definition component.h:91
constexpr uint32_t SCHEDULER_DONT_RUN
Definition component.h:63
void IRAM_ATTR wake_loop_any_context()
IRAM_ATTR entry point for ISR callers — defined in wake_esp8266.cpp.
static void uint32_t
static uint64_t global_recorded_us
Definition component.h:126
uint16_t length
Definition tt21100.cpp:0