From a92afa191c8258aebfc93d37e50ba73c2c8476e2 Mon Sep 17 00:00:00 2001 From: Pixel Perfect Date: Sat, 1 Aug 2026 21:59:17 -0700 Subject: [PATCH] fix(storage): gate loop watchdog APIs in IDF apps Signed-off-by: Pixel Perfect --- src/helpers/esp32/WdtHeavyGuard.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/helpers/esp32/WdtHeavyGuard.h b/src/helpers/esp32/WdtHeavyGuard.h index b8d0c34..8e6d646 100644 --- a/src/helpers/esp32/WdtHeavyGuard.h +++ b/src/helpers/esp32/WdtHeavyGuard.h @@ -38,6 +38,7 @@ inline void wdtHeavyEnd() { int& d = _wdtHeavyDepth(); if (d > 0 && --d == 0) // work instead of silently arming a new watchdog on the way out. The guard can // be constructed by a storage worker, so query Arduino's loopTask handle rather // than `nullptr` (which means the current worker task to ESP-IDF). +#if defined(CONFIG_AUTOSTART_ARDUINO) extern TaskHandle_t loopTaskHandle; struct LoopWdtGuard { bool subscribed; @@ -50,6 +51,11 @@ struct LoopWdtGuard { } }; #else +// Tanmatsu and T-Display-P4 supply app_main() themselves. Their Arduino +// component has no loopTaskHandle or loop-WDT helpers to preserve. +struct LoopWdtGuard {}; +#endif +#else inline void wdtHeavyBegin() {} inline void wdtHeavyEnd() {} struct LoopWdtGuard {};