FastLED 3.10.8
Loading...
Searching...
No Matches

◆ scopedWatchdogFirstInit()

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

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

175 {
177 wdt.begin(timeout_ms);
178
179 ResetInfo info = wdt.lastResetInfo();
180 if (info.cause == ResetCause::WATCHDOG ||
181 info.cause == ResetCause::PANIC ||
182 info.cause == ResetCause::LOCKUP) {
183 char buf[128];
184 fl::size n = info.describe(fl::span<char>(buf, sizeof(buf)), /*verbose=*/true);
185 scopedWatchdogPrintLine(fl::string_view("[FastLED.watchdog] recovered from:"));
187
188 if (wdt.hasCrashReport()) {
189 // Hook for Tier 2 platforms. Future revision: also emit a
190 // multi-line CrashReport::describe() result here. For now the
191 // bare cause + raw register is the documented contract.
192 }
194 }
195 scopedWatchdogPrintLine(fl::string_view("[FastLED.watchdog] armed via FL_WATCHDOG_AUTO()"));
196}
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: