mirror of
https://github.com/esphome/esphome.git
synced 2026-09-12 07:47:33 +00:00
c30aa4aad4c34df7226d4dc5002e101aeca000c5
When `g_main_loop_woke` is already set on entry to `wakeable_delay()`, both the ESP8266 and RP2040 paths consume the flag and return without yielding. That's safe in isolation, but if a caller loops on `wakeable_delay()` (e.g. `LWIPRawImpl::wait_for_data_()` waiting for SO_RCVTIMEO), and ISR sources (GPIO, timer, WiFi RX on ESP8266; alarm / async on RP2040) keep re-setting the flag between iterations, every iteration takes the fast path and the loop never yields. That can starve the SDK / async context, blocking actual TCP delivery to our socket and causing OTA reads to time out on busy devices even though there is data in flight. The PR that introduced `wait_for_data_()` (#14675) relied on `wakeable_delay()` to yield on every iteration; this restores that property on the fast path. Adds `delay(0)` on ESP8266 and `yield()` on RP2040 to the fast path, matching the yield behaviour those platforms already use for the `ms == 0` poll case.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
592 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
