Inline ESP8266 wakeable_delay (no static state, 5 lines)

This commit is contained in:
J. Nick Koston
2026-04-04 11:07:41 -10:00
parent aaead7b5eb
commit 0bf0fc7eb8
2 changed files with 8 additions and 13 deletions
-11
View File
@@ -29,17 +29,6 @@ volatile bool g_main_loop_woke = false;
void IRAM_ATTR wake_loop_any_context() { wake_loop_impl_(); }
namespace internal {
void wakeable_delay(uint32_t ms) {
if (ms == 0) {
delay(0);
return;
}
g_main_loop_woke = false;
esp_delay(ms, []() { return !g_main_loop_woke; });
}
} // namespace internal
#endif // USE_ESP8266
// === RP2040 — wakeable_delay (wake functions are inline in wake.h) ===
+8 -2
View File
@@ -87,8 +87,14 @@ void wake_loop_any_context();
inline void wake_loop_threadsafe() { wake_loop_impl_(); }
namespace internal {
/// Wakeable delay for ESP8266. Defined in wake.cpp.
void wakeable_delay(uint32_t ms);
inline void wakeable_delay(uint32_t ms) {
if (ms == 0) {
delay(0);
return;
}
g_main_loop_woke = false;
esp_delay(ms, []() { return !g_main_loop_woke; });
}
} // namespace internal
// === RP2040 ===