From 8cbf3e354b26175945a1dbdb77b25fc690b9b824 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 4 Apr 2026 10:49:22 -1000 Subject: [PATCH] Define wakeable_delay on all platforms, simplify yield_with_select_ --- esphome/core/application.h | 4 +--- esphome/core/wake.h | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/esphome/core/application.h b/esphome/core/application.h index d67baad005f..08562e3c070 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -916,10 +916,8 @@ inline void ESPHOME_ALWAYS_INLINE Application::yield_with_select_(uint32_t delay // Sleep with instant wake via FreeRTOS task notification. // Woken by: callback wrapper (socket data), wake_loop_threadsafe() (background tasks), or timeout. esphome::wakeable_delay(delay_ms); -#elif defined(USE_ESP8266) || defined(USE_RP2040) - esphome::wakeable_delay(delay_ms); #else - delay(delay_ms); + esphome::wakeable_delay(delay_ms); #endif } #endif // !USE_SOCKET_SELECT_SUPPORT diff --git a/esphome/core/wake.h b/esphome/core/wake.h index ae9fc8d3555..1580b309d68 100644 --- a/esphome/core/wake.h +++ b/esphome/core/wake.h @@ -112,6 +112,9 @@ void wake_loop_threadsafe(); /// Host: no ISR, just use threadsafe version. inline void wake_loop_any_context() { wake_loop_threadsafe(); } +/// Host: select() handles the delay, this is a simple fallback. +inline void wakeable_delay(uint32_t ms) { delay(ms); } + #endif } // namespace esphome