8#include <hardware/sync.h>
21static volatile bool s_delay_expired =
false;
23static int64_t alarm_callback_(alarm_id_t
id,
void *user_data) {
26 s_delay_expired =
true;
33 if (ms == 0) [[unlikely]] {
45 s_delay_expired =
false;
46 alarm_id_t alarm = add_alarm_in_ms(ms, alarm_callback_,
nullptr,
true);
void ESPHOME_ALWAYS_INLINE wakeable_delay(uint32_t ms)
Host wakeable_delay uses select() over the registered fds — defined in wake_host.cpp.
std::atomic< uint8_t > g_wake_requested
volatile bool g_main_loop_woke
void HOT delay(uint32_t ms)
Platform-specific main loop wake primitives.