mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
c71f8b5ba994ba2ca94679b54e40bbfbe1c55d88
Mirrors the existing bk72xx platform override, but auto-scales to the user-configurable esp32.watchdog_timeout (CONFIG_ESP_TASK_WDT_TIMEOUT_S) instead of hard-coding a constant: the feed interval is always 1/5 of the configured task WDT timeout so the safety margin stays constant across user configurations. - default 5 s WDT -> 1000 ms feed interval (was 300 ms, -70% hits) - 10 s WDT -> 2000 ms feed interval - 60 s WDT (max) -> 12000 ms feed interval esp_task_wdt_reset() takes a spinlock and walks the WDT task list, so every call costs tens of microseconds. At the normal ~62 Hz main loop the old 300 ms cadence produced ~200 feed_wdt_slow_ hits per 60 s period; the default 5s -> 1000 ms cuts that to ~60 hits (-70%). Component-level feeds inside Component::loop() and scheduler items are unaffected; they continue to call arch_feed_wdt after every operation, so any op exceeding this rate-limit triggers a real feed naturally. The rate-limit only applies to the outer guard in Application::loop() that fires when nothing else fed recently. esp32/__init__.py already constrains watchdog_timeout to >= 5 s (range 5-60 s), and a static_assert guards against anyone who tweaks sdkconfig below that floor, ensuring the feed interval never drops below the prior hardcoded 1000 ms value. Measured on a live ESP32 IDF build (gatetrigger.yaml, default 5 s WDT) via runtime_stats: wdt bucket dropped from 2.24 us/iter to 1.56 us/iter - about 2.5 ms saved per 60 s window.
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%
