Compare commits

...

3 Commits

Author SHA1 Message Date
J. Nick Koston
45dd576941 Merge branch 'dev' into esp8266_high_freq_loop 2026-01-25 08:27:00 -10:00
J. Nick Koston
d692ac281c 100% the same 2026-01-25 08:24:48 -10:00
J. Nick Koston
929af941f8 [socket] Fix ESP8266 watchdog timeout when running high-frequency loops 2026-01-25 08:02:27 -10:00

View File

@@ -29,6 +29,14 @@ void socket_delay(uint32_t ms) {
// Use esp_delay with a callback that checks if socket data arrived.
// This allows the delay to exit early when socket_wake() is called by
// lwip recv_fn/accept_fn callbacks, reducing socket latency.
//
// When ms is 0, we must use delay(0) because esp_delay(0, callback)
// exits immediately without yielding, which can cause watchdog timeouts
// when the main loop runs in high-frequency mode (e.g., during light effects).
if (ms == 0) {
delay(0);
return;
}
s_socket_woke = false;
esp_delay(ms, []() { return !s_socket_woke; });
}