mirror of
https://github.com/esphome/esphome.git
synced 2026-09-18 10:38:38 +00:00
Define wakeable_delay on all platforms, simplify yield_with_select_
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user