mirror of
https://github.com/ALLFATHER-BV/wadamesh.git
synced 2026-10-13 21:47:23 +00:00
fix(storage): gate loop watchdog APIs in IDF apps
Signed-off-by: Pixel Perfect <me@pixp.cc>
This commit is contained in:
@@ -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 {};
|
||||
|
||||
Reference in New Issue
Block a user