FastLED 3.9.15
Loading...
Searching...
No Matches

◆ scopedWatchdogFirstInit()

void fl::platforms::scopedWatchdogFirstInit ( fl::u32 timeout_ms)
inline

Definition at line 129 of file watchdog.cpp.hpp.

129 {
131 wdt.begin(timeout_ms);
132
133 ResetInfo info = wdt.lastResetInfo();
134 if (info.cause == ResetCause::WATCHDOG ||
135 info.cause == ResetCause::PANIC ||
136 info.cause == ResetCause::LOCKUP) {
137 char buf[128];
138 fl::size n = info.describe(fl::span<char>(buf, sizeof(buf)), /*verbose=*/true);
139 scopedWatchdogPrintLine(fl::string_view("[FastLED.watchdog] recovered from:"));
141
142 if (wdt.hasCrashReport()) {
143 // Hook for Tier 2 platforms. Future revision: also emit a
144 // multi-line CrashReport::describe() result here. For now the
145 // bare cause + raw register is the documented contract.
146 }
148 }
149 scopedWatchdogPrintLine(fl::string_view("[FastLED.watchdog] armed via FL_WATCHDOG_AUTO()"));
150}
static Watchdog & instance() FL_NOEXCEPT
void begin(fl::u32 timeout_ms) FL_NOEXCEPT
bool hasCrashReport() const FL_NOEXCEPT
ResetInfo lastResetInfo() const FL_NOEXCEPT
Detailed reset information including platform raw register + subcause id.
Unified cross-platform watchdog interface.
Definition watchdog.h:123
void scopedWatchdogPrintLine(fl::string_view sv) FL_NOEXCEPT
void scopedWatchdogPause3s() FL_NOEXCEPT
ResetCause cause
Normalized cross-platform enum.
Definition watchdog.h:83
fl::size describe(fl::span< char > out, bool verbose=false) const FL_NOEXCEPT
Write a single-line human-readable description into the caller's buffer.
Detailed reset information bundling the normalized cause with a platform-specific subcause id and the...
Definition watchdog.h:82

References fl::Watchdog::begin(), fl::ResetInfo::cause, fl::ResetInfo::describe(), FL_NOEXCEPT, fl::Watchdog::hasCrashReport(), fl::Watchdog::instance(), fl::Watchdog::lastResetInfo(), fl::LOCKUP, fl::PANIC, scopedWatchdogPause3s(), scopedWatchdogPrintLine(), and fl::WATCHDOG.

Referenced by fl::ScopedWatchdog::ScopedWatchdog().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: