mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
eb5da72dabcc3cf985b6832684fb87c5094fe4bf
With the listener filter from the previous commit, the wake hook only fires on actual OTA connection attempts — no more spurious wakes from API client data packets or other monitored-socket traffic. That removes the motivation for inlining the hook at three call sites. Collapse back to the simpler shape: - Application gains Component *ota_wake_component_ (one pointer, 4 bytes, gated on USE_OTA) and a wake_ota_component_any_context() inline method. - lwip_fast_select.c reaches the method via an extern-C trampoline (esphome_wake_ota_component_any_context) defined in application.cpp. One call_n instruction per actual wake, which now happens at most once per real OTA upload attempt. - Raw-TCP (LWIPRawListenImpl::accept_fn_) and host select paths call App.wake_ota_component_any_context() directly — both are .cpp files. - wake.h reverts to its pre-PR state (no C-compatible section, no extern pointer globals, no inline OTA hook). All wake-related state still lives in Application. Net effect versus the inline approach: - RAM: -4 bytes (one pointer vs two) - Flash: ~-60 bytes (no 3x duplication of the inlined hook body) - CPU: function-call overhead (~10 cycles) paid only on actual OTA wakes, which happen ~0 times/sec in steady state. Inline was premature once filtering reduced the fire rate to "rare intentional events."
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
546 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
