FastLED 3.10.6
Loading...
Searching...
No Matches

◆ scopedWatchdogFirstInit()

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

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

159 {
161 wdt.begin(timeout_ms);
162
163 ResetInfo info = wdt.lastResetInfo();
164 if (info.cause == ResetCause::WATCHDOG ||
165 info.cause == ResetCause::PANIC ||
166 info.cause == ResetCause::LOCKUP) {
167 char buf[128];
168 fl::size n = info.describe(fl::span<char>(buf, sizeof(buf)), /*verbose=*/true);
169 scopedWatchdogPrintLine(fl::string_view("[FastLED.watchdog] recovered from:"));
171
172 if (wdt.hasCrashReport()) {
173 // Hook for Tier 2 platforms. Future revision: also emit a
174 // multi-line CrashReport::describe() result here. For now the
175 // bare cause + raw register is the documented contract.
176 }
178 }
179 scopedWatchdogPrintLine(fl::string_view("[FastLED.watchdog] armed via FL_WATCHDOG_AUTO()"));
180}
static Watchdog & instance() FL_NO_EXCEPT
void begin(fl::u32 timeout_ms) FL_NO_EXCEPT
ResetInfo lastResetInfo() const FL_NO_EXCEPT
Detailed reset information including platform raw register + subcause id.
bool hasCrashReport() const FL_NO_EXCEPT
Unified cross-platform watchdog interface.
Definition watchdog.h:123
void scopedWatchdogPrintLine(fl::string_view sv) FL_NO_EXCEPT
void scopedWatchdogPause3s() FL_NO_EXCEPT
ResetCause cause
Normalized cross-platform enum.
Definition watchdog.h:83
fl::size describe(fl::span< char > out, bool verbose=false) const FL_NO_EXCEPT
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::FL_NO_EXCEPT, 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: