ESPHome 2026.5.0
Loading...
Searching...
No Matches
application.cpp
Go to the documentation of this file.
3#include "esphome/core/log.h"
5#include <cstring>
6
7#ifdef USE_ESP8266
8#include <pgmspace.h>
9#endif
10#ifdef USE_ESP32
11#include <esp_chip_info.h>
12#include <esp_ota_ops.h>
13#include <esp_bootloader_desc.h>
14#endif
16#include "esphome/core/hal.h"
17#include <algorithm>
18#include <ranges>
19
20#ifdef USE_STATUS_LED
22#endif
23
24namespace esphome {
25
26static const char *const TAG = "app";
27
28// Delay after setup() finishes before trimming the scheduler freelist of its post-boot peak.
29// 10 s is well past the bulk of post-setup async work (Wi-Fi/MQTT connects, first-read latency).
30static constexpr uint32_t SCHEDULER_FREELIST_TRIM_DELAY_MS = 10000;
31
32// Helper function for insertion sort of components by priority
33// Using insertion sort instead of std::stable_sort saves ~1.3KB of flash
34// by avoiding template instantiations (std::rotate, std::stable_sort, lambdas)
35// IMPORTANT: This sort is stable (preserves relative order of equal elements),
36// which is necessary to maintain user-defined component order for same priority
37template<typename Iterator, float (Component::*GetPriority)() const>
38static void insertion_sort_by_priority(Iterator first, Iterator last) {
39 for (auto it = first + 1; it != last; ++it) {
40 auto key = *it;
41 float key_priority = (key->*GetPriority)();
42 auto j = it - 1;
43
44 // Using '<' (not '<=') ensures stability - equal priority components keep their order
45 while (j >= first && ((*j)->*GetPriority)() < key_priority) {
46 *(j + 1) = *j;
47 j--;
48 }
49 *(j + 1) = key;
50 }
51}
52
54 if (has_loop) {
56 }
57 this->components_.push_back(comp);
58}
60 ESP_LOGI(TAG, "Running through setup()");
61 ESP_LOGV(TAG, "Sorting components by setup priority");
62
63 // Sort by setup priority using our helper function
64 insertion_sort_by_priority<decltype(this->components_.begin()), &Component::get_actual_setup_priority>(
65 this->components_.begin(), this->components_.end());
66
67 // Initialize looping_components_ early so enable_pending_loops_() works during setup
69
70 for (uint32_t i = 0; i < this->components_.size(); i++) {
72
73 // Update loop_component_start_time_ before calling each component during setup
74 this->loop_component_start_time_ = MillisInternal::get();
75 component->call();
76 this->scheduler.process_to_add();
77 this->feed_wdt();
78 if (component->can_proceed())
79 continue;
80
81 // Force the status LED to blink WARNING while we wait for a slow
82 // component to come up. Cleared after setup() finishes if no real
83 // component has warning set.
85
86 do {
87 // Service scheduler and process pending loop enables to handle GPIO
88 // interrupts during setup. During setup we always run the component
89 // phase (no loop_interval_ gate), so call both helpers unconditionally.
90 this->scheduler_tick_(MillisInternal::get());
91 {
92 ComponentPhaseGuard phase_guard{*this};
93
94 for (uint32_t j = 0; j <= i; j++) {
95 // Update loop_component_start_time_ right before calling each component
96 this->loop_component_start_time_ = MillisInternal::get();
97 this->components_[j]->call();
98 this->feed_wdt();
99 }
100 }
101 yield();
102 } while (!component->can_proceed() && !component->is_failed());
103 }
104
105 // Setup is complete. Reconcile STATUS_LED_WARNING: the slow-setup path
106 // above may have forced it on, and any status_clear_warning() calls
107 // from components during setup were intentional no-ops (gated by
108 // APP_STATE_SETUP_COMPLETE). Walk components once here to pick up the
109 // real state. STATUS_LED_ERROR is never artificially forced, so its
110 // clear path always works and needs no reconciliation. Finally, set
111 // APP_STATE_SETUP_COMPLETE so subsequent warning clears go through
112 // the normal walk-and-clear path.
114 this->app_state_ &= ~STATUS_LED_WARNING;
116
117 ESP_LOGI(TAG, "setup() finished successfully!");
118
119 // Trim the scheduler freelist of its post-boot peak once startup churn settles.
120 this->scheduler.set_timeout(this, SCHEDULER_FREELIST_TRIM_DELAY_MS, [this]() { this->scheduler.trim_freelist(); });
121
122#ifdef USE_SETUP_PRIORITY_OVERRIDE
123 // Clear setup priority overrides to free memory
125#endif
126
127#if defined(USE_ESP32) || defined(USE_LIBRETINY)
128 // Save main loop task handle for wake_loop_*() / fast select FreeRTOS notifications.
129 esphome_main_task_handle = xTaskGetCurrentTaskHandle();
130#endif
131#ifdef USE_HOST
132 // Set up wake socket for waking main loop from tasks (host platform select() loop).
133 wake_setup();
134#endif
135
136 // Ensure all active looping components are in LOOP state.
137 // Components after the last blocking component only got one call() during setup
138 // (CONSTRUCTION→SETUP) and never received the second call() (SETUP→LOOP).
139 // The main loop calls loop() directly, bypassing call()'s state machine.
140 for (uint16_t i = 0; i < this->looping_components_active_end_; i++) {
141 this->looping_components_[i]->set_component_state_(COMPONENT_STATE_LOOP);
142 }
143
144 this->schedule_dump_config();
145}
146
147void Application::process_dump_config_() {
148 if (this->dump_config_at_ == 0) {
149 char build_time_str[Application::BUILD_TIME_STR_SIZE];
150 this->get_build_time_string(build_time_str);
151 ESP_LOGI(TAG, "ESPHome version " ESPHOME_VERSION " compiled on %s", build_time_str);
152#ifdef ESPHOME_PROJECT_NAME
153 ESP_LOGI(TAG, "Project " ESPHOME_PROJECT_NAME " version " ESPHOME_PROJECT_VERSION);
154#endif
155#ifdef USE_ESP32
156 esp_chip_info_t chip_info;
157 esp_chip_info(&chip_info);
158 ESP_LOGI(TAG, "ESP32 Chip: %s rev%d.%d, %d core(s)", ESPHOME_VARIANT, chip_info.revision / 100,
159 chip_info.revision % 100, chip_info.cores);
160#if defined(USE_ESP32_VARIANT_ESP32) && (!defined(USE_ESP32_MIN_CHIP_REVISION_SET) || !defined(USE_ESP32_SRAM1_AS_IRAM))
161 static const char *const ESP32_ADVANCED_PATH = "under esp32 > framework > advanced";
162#endif
163#if defined(USE_ESP32_VARIANT_ESP32) && !defined(USE_ESP32_MIN_CHIP_REVISION_SET)
164 {
165 // Suggest optimization for chips that don't need the PSRAM cache workaround
166 if (chip_info.revision >= 300) {
167#ifdef USE_PSRAM
168 ESP_LOGW(TAG, "Chip rev >= 3.0 detected. Set minimum_chip_revision: \"%d.%d\" %s to save ~10KB IRAM",
169 chip_info.revision / 100, chip_info.revision % 100, ESP32_ADVANCED_PATH);
170#else
171 ESP_LOGW(TAG, "Chip rev >= 3.0 detected. Set minimum_chip_revision: \"%d.%d\" %s to reduce binary size",
172 chip_info.revision / 100, chip_info.revision % 100, ESP32_ADVANCED_PATH);
173#endif
174 }
175 }
176#endif
177 {
178 // esp_bootloader_desc_t is available in ESP-IDF >= 5.2; if readable the bootloader is modern.
179 //
180 // Design decision: We intentionally do NOT mention sram1_as_iram when the bootloader is too old.
181 // Enabling sram1_as_iram with an old bootloader causes a hard brick (device fails to boot,
182 // requires USB reflash to recover). Users don't always read warnings carefully, so we only
183 // suggest the option once we've confirmed the bootloader can handle it. In practice this
184 // means a user with an old bootloader may need to flash twice: once via USB to update the
185 // bootloader (they'll see the suggestion on next boot), then OTA with sram1_as_iram: true.
186 // Two flashes is a better outcome than a bricked device.
187 esp_bootloader_desc_t boot_desc;
188 if (esp_ota_get_bootloader_description(nullptr, &boot_desc) != ESP_OK) {
189#ifdef USE_ESP32_VARIANT_ESP32
190 ESP_LOGW(TAG, "Bootloader too old for OTA rollback and SRAM1 as IRAM (+40KB). "
191 "Flash via USB once to update the bootloader");
192#else
193 ESP_LOGW(TAG, "Bootloader too old for OTA rollback. Flash via USB once to update the bootloader");
194#endif
195 }
196#if defined(USE_ESP32_VARIANT_ESP32) && !defined(USE_ESP32_SRAM1_AS_IRAM)
197 else {
198 ESP_LOGW(TAG, "Bootloader supports SRAM1 as IRAM (+40KB). Set sram1_as_iram: true %s", ESP32_ADVANCED_PATH);
199 }
200#endif
201 }
202#endif // USE_ESP32
203 }
204
205 this->components_[this->dump_config_at_]->call_dump_config_();
206 this->dump_config_at_++;
207}
208
210 // Cold entry: callers without a millis() timestamp in hand. Fetches the
211 // time and defers to the hot path.
212 this->feed_wdt_with_time(MillisInternal::get());
213}
214
216 // Callers (both feed_wdt() and feed_wdt_with_time()) have already
217 // confirmed the WDT_FEED_INTERVAL_MS rate limit was exceeded.
219 this->last_wdt_feed_ = time;
220}
221
222#ifdef USE_STATUS_LED
224 // Callers (feed_wdt(), feed_wdt_with_time()) have already confirmed the
225 // STATUS_LED_DISPATCH_INTERVAL_MS rate limit was exceeded. Rate-limited
226 // separately from arch_feed_wdt() so the LED blink pattern stays readable
227 // (status_led error blink period is 250 ms) while HAL watchdog pokes can
228 // still run at the much coarser WDT_FEED_INTERVAL_MS cadence.
229 this->last_status_led_service_ = time;
230 if (status_led::global_status_led == nullptr)
231 return;
233 uint8_t sl_state = sl->get_component_state() & COMPONENT_STATE_MASK;
234 if (sl_state == COMPONENT_STATE_LOOP_DONE) {
235 // status_led only transitions to LOOP_DONE from inside its own loop() (after the
236 // first idle-path dispatch), so its pin is already initialized by pre_setup() and
237 // its setup() has already run. Re-dispatch only if an error or warning bit has been
238 // set since; otherwise skip entirely.
239 if ((this->app_state_ & STATUS_LED_MASK) == 0)
240 return;
241 sl->enable_loop();
242 } else if (sl_state != COMPONENT_STATE_LOOP) {
243 // CONSTRUCTION/SETUP/FAILED: not our job — App::setup() drives the lifecycle.
244 return;
245 }
246 sl->loop();
247}
248#endif
249
251 // Walk all components (not just looping ones) so non-looping components'
252 // status bits are respected. Only called from the slow-path clear helpers
253 // (status_clear_warning_slow_path_ / status_clear_error_slow_path_) on an
254 // actual set→clear transition, so walking O(N) here is paid once per
255 // transition — not once per loop iteration.
256 for (auto *component : this->components_) {
257 if ((component->get_component_state() & flag) != 0)
258 return true;
259 }
260 return false;
261}
262
264 ESP_LOGI(TAG, "Forcing a reboot");
265 for (auto &component : std::ranges::reverse_view(this->components_)) {
266 component->on_shutdown();
267 }
268 arch_restart();
269}
271 ESP_LOGI(TAG, "Rebooting safely");
273 teardown_components(TEARDOWN_TIMEOUT_REBOOT_MS);
275 arch_restart();
276}
277
279 for (auto &component : std::ranges::reverse_view(this->components_)) {
280 component->on_safe_shutdown();
281 }
282 for (auto &component : std::ranges::reverse_view(this->components_)) {
283 component->on_shutdown();
284 }
285}
286
288 for (auto &component : std::ranges::reverse_view(this->components_)) {
289 component->on_powerdown();
290 }
291}
292
294 uint32_t start_time = MillisInternal::get();
295
296 // Use a StaticVector instead of std::vector to avoid heap allocation
297 // since we know the actual size at compile time
299
300 // Copy all components in reverse order
301 // Reverse order matches the behavior of run_safe_shutdown_hooks() above and ensures
302 // components are torn down in the opposite order of their setup_priority (which is
303 // used to sort components during Application::setup())
304 size_t num_components = this->components_.size();
305 for (size_t i = 0; i < num_components; ++i) {
306 pending_components[i] = this->components_[num_components - 1 - i];
307 }
308
309 uint32_t now = start_time;
310 size_t pending_count = num_components;
311
312 // Teardown Algorithm
313 // ==================
314 // We iterate through pending components, calling teardown() on each.
315 // Components that return false (need more time) are copied forward
316 // in the array. Components that return true (finished) are skipped.
317 //
318 // The compaction happens in-place during iteration:
319 // - still_pending tracks the write position (where to put next pending component)
320 // - i tracks the read position (which component we're testing)
321 // - When teardown() returns false, we copy component[i] to component[still_pending]
322 // - When teardown() returns true, we just skip it (don't increment still_pending)
323 //
324 // Example with 4 components where B can teardown immediately:
325 //
326 // Start:
327 // pending_components: [A, B, C, D]
328 // pending_count: 4 ^----------^
329 //
330 // Iteration 1:
331 // i=0: A needs more time → keep at pos 0 (no copy needed)
332 // i=1: B finished → skip
333 // i=2: C needs more time → copy to pos 1
334 // i=3: D needs more time → copy to pos 2
335 //
336 // After iteration 1:
337 // pending_components: [A, C, D | D]
338 // pending_count: 3 ^--------^
339 //
340 // Iteration 2:
341 // i=0: A finished → skip
342 // i=1: C needs more time → copy to pos 0
343 // i=2: D finished → skip
344 //
345 // After iteration 2:
346 // pending_components: [C | C, D, D] (positions 1-3 have old values)
347 // pending_count: 1 ^--^
348
349 while (pending_count > 0 && (now - start_time) < timeout_ms) {
350 // Feed watchdog during teardown to prevent triggering
351 this->feed_wdt_with_time(now);
352
353 // Process components and compact the array, keeping only those still pending
354 size_t still_pending = 0;
355 for (size_t i = 0; i < pending_count; ++i) {
356 if (!pending_components[i]->teardown()) {
357 // Component still needs time, copy it forward
358 if (still_pending != i) {
359 pending_components[still_pending] = pending_components[i];
360 }
361 ++still_pending;
362 }
363 // Component finished teardown, skip it (don't increment still_pending)
364 }
365 pending_count = still_pending;
366
367 // Give some time for I/O operations if components are still pending
368 if (pending_count > 0) {
370 }
371
372 // Update time for next iteration
373 now = MillisInternal::get();
374 }
375
376 if (pending_count > 0) {
377 // Note: At this point, connections are either disconnected or in a bad state,
378 // so this warning will only appear via serial rather than being transmitted to clients
379 for (size_t i = 0; i < pending_count; ++i) {
380 ESP_LOGW(TAG, "%s did not complete teardown within %" PRIu32 " ms",
381 LOG_STR_ARG(pending_components[i]->get_component_log_str()), timeout_ms);
382 }
383 }
384}
385
387 for (auto *obj : this->components_) {
388 if (obj->has_overridden_loop() &&
389 ((obj->get_component_state() & COMPONENT_STATE_MASK) == COMPONENT_STATE_LOOP_DONE) == match_loop_done) {
390 this->looping_components_.push_back(obj);
391 }
392 }
393}
394
396 // This method must be reentrant - components can disable themselves during their own loop() call
397 // Linear search to find component in active section
398 // Most configs have 10-30 looping components (30 is on the high end)
399 // O(n) is acceptable here as we optimize for memory, not complexity
400 for (uint16_t i = 0; i < this->looping_components_active_end_; i++) {
401 if (this->looping_components_[i] == component) {
402 // Move last active component to this position
403 this->looping_components_active_end_--;
404 if (i != this->looping_components_active_end_) {
405 std::swap(this->looping_components_[i], this->looping_components_[this->looping_components_active_end_]);
406
407 // If we're currently iterating and just swapped the current position
408 if (this->in_loop_ && i == this->current_loop_index_) {
409 // Decrement so we'll process the swapped component next
410 this->current_loop_index_--;
411 // Update the loop start time to current time so the swapped component
412 // gets correct timing instead of inheriting stale timing.
413 // This prevents integer underflow in timing calculations by ensuring
414 // the swapped component starts with a fresh timing reference, avoiding
415 // errors caused by stale or wrapped timing values.
416 this->loop_component_start_time_ = MillisInternal::get();
417 }
418 }
419 return;
420 }
421 }
422}
423
425 // Helper to move component from inactive to active section
426 if (index != this->looping_components_active_end_) {
427 std::swap(this->looping_components_[index], this->looping_components_[this->looping_components_active_end_]);
428 }
430}
431
433 // This method is only called when component state is LOOP_DONE, so we know
434 // the component must be in the inactive section (if it exists in looping_components_)
435 // Only search the inactive portion for better performance
436 // With typical 0-5 inactive components, O(k) is much faster than O(n)
437 const uint16_t size = this->looping_components_.size();
438 for (uint16_t i = this->looping_components_active_end_; i < size; i++) {
439 if (this->looping_components_[i] == component) {
440 // Found in inactive section - move to active
442 return;
443 }
444 }
445 // Component not found in looping_components_ - this is normal for components
446 // that don't have loop() or were not included in the partitioned vector
447}
448
450 // Process components that requested enable_loop from ISR context
451 // Only iterate through inactive looping_components_ (typically 0-5) instead of all components
452 //
453 // Race condition handling:
454 // 1. We check if component is already in LOOP state first - if so, just clear the flag
455 // This handles reentrancy where enable_loop() was called between ISR and processing
456 // 2. We only clear pending_enable_loop_ after checking state, preventing lost requests
457 // 3. If any components aren't in LOOP_DONE state, we set has_pending_enable_loop_requests_
458 // back to true to ensure we check again next iteration
459 // 4. ISRs can safely set flags at any time - worst case is we process them next iteration
460 // 5. The global flag (has_pending_enable_loop_requests_) is cleared before this method,
461 // so any ISR that fires during processing will be caught in the next loop
462 const uint16_t size = this->looping_components_.size();
463 bool has_pending = false;
464
465 for (uint16_t i = this->looping_components_active_end_; i < size; i++) {
467 if (!component->pending_enable_loop_) {
468 continue; // Skip components without pending requests
469 }
470
471 // Check current state
473
474 // If already in LOOP state, nothing to do - clear flag and continue
476 component->pending_enable_loop_ = false;
477 continue;
478 }
479
480 // If not in LOOP_DONE state, can't enable yet - keep flag set
482 has_pending = true; // Keep tracking this component
483 continue; // Keep the flag set - try again next iteration
484 }
485
486 // Clear the pending flag and enable the loop
487 component->pending_enable_loop_ = false;
488 ESP_LOGVV(TAG, "%s loop enabled from ISR", LOG_STR_ARG(component->get_component_log_str()));
489 component->set_component_state_(COMPONENT_STATE_LOOP);
490
491 // Move to active section
493 }
494
495 // If we couldn't process some requests, ensure we check again next iteration
496 if (has_pending) {
498 }
499}
500
501// App storage — asm label shares the linker symbol with "extern Application App".
502// char[] is trivially destructible, so no __cxa_atexit or destructor chain is emitted.
503// Constructed via placement new in the generated setup().
504#ifndef __GXX_ABI_VERSION
505#error "Application placement new requires Itanium C++ ABI (GCC/Clang)"
506#endif
507static_assert(std::is_default_constructible<Application>::value, "Application must be default-constructible");
508// __USER_LABEL_PREFIX__ is "_" on Mach-O (macOS) and empty on ELF (embedded targets).
509// String literal concatenation produces the correct platform-specific mangled symbol.
510// Two-level macro needed: # stringifies before expansion, so the
511// indirection forces __USER_LABEL_PREFIX__ to expand first.
512#define ESPHOME_STRINGIFY_IMPL_(x) #x
513#define ESPHOME_STRINGIFY_(x) ESPHOME_STRINGIFY_IMPL_(x)
514// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
515alignas(Application) char app_storage[sizeof(Application)] asm(
516 ESPHOME_STRINGIFY_(__USER_LABEL_PREFIX__) "_ZN7esphome3AppE");
517#undef ESPHOME_STRINGIFY_
518#undef ESPHOME_STRINGIFY_IMPL_
519
520void Application::get_build_time_string(std::span<char, BUILD_TIME_STR_SIZE> buffer) {
521 ESPHOME_strncpy_P(buffer.data(), ESPHOME_BUILD_TIME_STR, buffer.size());
522 buffer[buffer.size() - 1] = '\0';
523}
524
525void Application::get_comment_string(std::span<char, ESPHOME_COMMENT_SIZE_MAX> buffer) {
526 ESPHOME_strncpy_P(buffer.data(), ESPHOME_COMMENT_STR, ESPHOME_COMMENT_SIZE);
527 buffer[ESPHOME_COMMENT_SIZE - 1] = '\0';
528}
529
530uint32_t Application::get_config_hash() { return ESPHOME_CONFIG_HASH; }
531
532uint32_t Application::get_config_version_hash() { return fnv1a_hash_extend(ESPHOME_CONFIG_HASH, ESPHOME_VERSION); }
533
534time_t Application::get_build_time() { return ESPHOME_BUILD_TIME; }
535
536} // namespace esphome
uint32_t ESPHOME_ALWAYS_INLINE scheduler_tick_(uint32_t now)
void setup()
Reserve space for components to avoid memory fragmentation.
void ESPHOME_ALWAYS_INLINE feed_wdt_with_time(uint32_t time)
Feed the task watchdog, hot entry.
uint16_t looping_components_active_end_
void service_status_led_slow_(uint32_t time)
Slow path for the status_led dispatch rate limit.
static constexpr size_t BUILD_TIME_STR_SIZE
Size of buffer required for build time string (including null terminator)
uint32_t get_config_hash()
Get the config hash as a 32-bit integer.
StaticVector< Component *, ESPHOME_COMPONENT_COUNT > components_
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 get_build_time_string(std::span< char, BUILD_TIME_STR_SIZE > buffer)
Copy the build time string into the provided buffer Buffer must be BUILD_TIME_STR_SIZE bytes (compile...
void enable_component_loop_(Component *component)
uint32_t loop_component_start_time_
void feed_wdt()
Feed the task watchdog.
void disable_component_loop_(Component *component)
void activate_looping_component_(uint16_t index)
uint32_t last_status_led_service_
void teardown_components(uint32_t timeout_ms)
Teardown all components with a timeout.
FixedVector< Component * > looping_components_
void add_looping_components_by_state_(bool match_loop_done)
volatile bool has_pending_enable_loop_requests_
void get_comment_string(std::span< char, ESPHOME_COMMENT_SIZE_MAX > buffer)
Copy the comment string into the provided buffer.
void feed_wdt_slow_(uint32_t time)
Slow path for feed_wdt(): actually calls arch_feed_wdt() and updates last_wdt_feed_.
uint16_t current_loop_index_
time_t get_build_time()
Get the build time as a Unix timestamp.
uint32_t get_config_version_hash()
Get the config hash extended with ESPHome version.
void calculate_looping_components_()
void register_component_impl_(Component *comp, bool has_loop)
float get_actual_setup_priority() const
uint8_t get_component_state() const
Definition component.h:193
virtual bool can_proceed()
uint8_t component_state_
State of this component - each bit has a purpose: Bits 0-2: Component state (0x00=CONSTRUCTION,...
Definition component.h:587
Minimal static vector - saves memory by avoiding std::vector overhead.
Definition helpers.h:217
size_t size() const
Definition helpers.h:277
const Component * component
Definition component.cpp:34
void yield(void)
bool state
Definition fan.h:2
TaskHandle_t esphome_main_task_handle
Main loop task handle and wake helpers — shared between wake.h (C++) and lwip_fast_select....
Definition main_task.c:4
void ESPHOME_ALWAYS_INLINE wakeable_delay(uint32_t ms)
Host wakeable_delay uses select() over the registered fds — defined in wake_host.cpp.
const char *const TAG
Definition spi.cpp:7
StatusLED * global_status_led
constexpr uint8_t COMPONENT_HAS_LOOP
Definition component.h:91
constexpr uint32_t fnv1a_hash_extend(uint32_t hash, const char *str)
Extend a FNV-1a hash with additional string data.
Definition helpers.h:811
constexpr uint8_t STATUS_LED_MASK
Definition component.h:86
constexpr uint8_t COMPONENT_STATE_LOOP
Definition component.h:82
constexpr uint8_t APP_STATE_SETUP_COMPLETE
Definition component.h:96
constexpr uint8_t STATUS_LED_WARNING
Definition component.h:88
constexpr uint8_t COMPONENT_STATE_MASK
Definition component.h:79
uint16_t size
Definition helpers.cpp:25
void clear_setup_priority_overrides()
void arch_feed_wdt()
Definition hal.cpp:53
constexpr uint8_t COMPONENT_STATE_LOOP_DONE
Definition component.h:84
void wake_setup()
One-time setup of the loopback wake socket. Called from Application::setup().
void arch_restart()
Definition hal.cpp:39
static void uint32_t