diff --git a/esphome/core/application.h b/esphome/core/application.h index 8280b3bd4b..9dc397f526 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -219,11 +219,22 @@ class Application { /// loops and scheduler items still feed after every op, so any op exceeding /// this threshold triggers a real feed naturally. /// Safety margins vs. platform watchdog timeouts: - /// - ESP32 task WDT default (5 s): ~16x - /// - ESP8266 soft WDT (~1.6 s): ~5x <-- floor case; any future change - /// must keep comfortable margin here - /// - ESP8266 HW WDT (~6 s): ~20x + /// - ESP32 task WDT default (5 s): ~16x + /// - ESP8266 soft WDT (~1.6 s): ~5x <-- floor case; any future change + /// must keep comfortable margin here + /// - ESP8266 HW WDT (~6 s): ~20x + /// - BK72xx HW WDT (10 s): ~5x <-- platform override below +#ifdef USE_BK72XX + /// BK72xx silicon requires a ~200 µs busy-wait between two watchdog register + /// key writes on every reload (sctrl_dpll_delay200us() in BDK wdt.c), making + /// each arch_feed_wdt() ~300 µs. LibreTiny initialises the HW WDT at 10 s, + /// so 2000 ms keeps a 5x safety margin — matching the ESP8266 ratio that + /// motivated the generic 300 ms value — while cutting feed frequency ~6x + /// and recovering ~50 ms/min of main-loop overhead on typical configs. + static constexpr uint32_t WDT_FEED_INTERVAL_MS = 2000; +#else static constexpr uint32_t WDT_FEED_INTERVAL_MS = 300; +#endif /// Feed the task watchdog. Cold entry — callers without a millis() /// timestamp in hand. Out of line to keep call sites tiny.