mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
a70ec9ec06931956d8ea8279e8820b147cebfdf8
The main loop used to feed the watchdog unconditionally right after Scheduler::call() returned, regardless of whether the scheduler had any actual work to do. On an idle device this meant every outer loop iteration paid the inline rate-limit check (load + sub + branch) for no benefit. Move the feed into Scheduler::execute_item_() so it fires only after a scheduled callback actually runs, and covers both the main heap path and the defer queue path (both go through execute_item_). This also bounds the max feed gap during a burst of back-to-back scheduled items by max(item_runtime) instead of sum(item_runtime). The top-of-loop feed in Application::before_loop_tasks_() is now unnecessary — when Scheduler::call does no work, the only elapsed time is the sleep wake plus a few instructions, and when it does have work, it fed the wdt as it went.
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%
