Fix Zephyr build: add fallback wakeable_delay and wake_loop_threadsafe

This commit is contained in:
J. Nick Koston
2026-04-04 11:58:33 -10:00
parent ac95bde627
commit 36b3d35d15
+17 -2
View File
@@ -94,14 +94,29 @@ namespace internal {
void wakeable_delay(uint32_t ms);
} // namespace internal
// === Host (UDP loopback socket) ===
// === Host / Zephyr / other ===
#else
/// Defined in wake.cpp.
#ifdef USE_HOST
/// Host: wakes select() via UDP loopback socket. Defined in wake.cpp.
void wake_loop_threadsafe();
#else
/// Fallback for platforms without a specific wake mechanism.
inline void wake_loop_threadsafe() {}
#endif
inline void wake_loop_any_context() { wake_loop_threadsafe(); }
namespace internal {
inline void wakeable_delay(uint32_t ms) {
if (ms == 0) {
yield();
return;
}
delay(ms);
}
} // namespace internal
#endif
} // namespace esphome