fix(storage): gate loop watchdog APIs in IDF apps

Signed-off-by: Pixel Perfect <me@pixp.cc>
This commit is contained in:
Pixel Perfect
2026-08-01 21:59:17 -07:00
parent 1e6a6b4b35
commit a92afa191c
+6
View File
@@ -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 {};