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