mirror of
https://github.com/esphome/esphome.git
synced 2026-09-02 19:16:06 +00:00
Fix Zephyr build: add fallback wakeable_delay and wake_loop_threadsafe
This commit is contained in:
+17
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user