mirror of
https://github.com/esphome/esphome.git
synced 2026-09-17 01:58:39 +00:00
2d4117f370c32ace1b959d4d47ad25f436ac1c91
enable_loop_soon_any_context() sets volatile flags but does not wake the main loop from ulTaskNotifyTake() sleep. This means components using ISR-driven state changes (e.g. GPIO binary sensors) wait up to ~16ms for the select timeout before their loop runs. Add wake_loop_any_context() that detects the calling context (ISR vs task) using xPortInIsrContext() (ESP32) or __get_IPSR() (LibreTiny) and calls the appropriate FreeRTOS API. This is safe from ISR, thread, and main loop contexts. Also relax the wake_loop_isrsafe() guard from requiring both USE_WAKE_LOOP_THREADSAFE and USE_LWIP_FAST_SELECT to just USE_LWIP_FAST_SELECT, since the ISR wake path uses vTaskNotifyGiveFromISR directly and does not depend on the UDP socket mechanism.
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
596 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
