258#define FL_WATCHDOG__CONCAT_INNER(a, b) a##b
259#define FL_WATCHDOG__CONCAT(a, b) FL_WATCHDOG__CONCAT_INNER(a, b)
260#define FL_WATCHDOG_AUTO(...) \
261 ::fl::ScopedWatchdog FL_WATCHDOG__CONCAT(_fl_wdt_, __LINE__) { __VA_ARGS__ }
ScopedWatchdog() FL_NOEXCEPT
Default construct with the library default timeout (15 000 ms).
RAII watchdog guard for the canonical loop()-top use case.
fl::u16 mSafeModeThreshold
static Watchdog & instance() FL_NOEXCEPT
void disable() FL_NOEXCEPT
fl::size readCrashLog(fl::span< fl::u8 > out) const FL_NOEXCEPT
void markCleanShutdown() FL_NOEXCEPT
void begin(fl::u32 timeout_ms) FL_NOEXCEPT
bool setPauseOnDebug(bool pause) FL_NOEXCEPT
fl::u8 persistRead(fl::size idx) const FL_NOEXCEPT
bool rebootIntoBootloader() FL_NOEXCEPT
fl::u16 safeModeThreshold() const FL_NOEXCEPT
bool hasCrashReport() const FL_NOEXCEPT
void persistWrite(fl::size idx, fl::u8 v) FL_NOEXCEPT
ResetCause lastResetCause() const FL_NOEXCEPT
bool onTimeout(WatchdogTimeoutCallback cb, void *user_data=nullptr) FL_NOEXCEPT
WatchdogCrashReport readCrashReport() const FL_NOEXCEPT
bool setWindow(fl::u32 window_min_ms, fl::u32 window_max_ms) FL_NOEXCEPT
Watchdog() FL_NOEXCEPT=default
bool writeCrashLog(fl::span< const fl::u8 > payload) FL_NOEXCEPT
fl::u16 consecutiveCrashCount() const FL_NOEXCEPT
void setSafeModeThreshold(fl::u16 threshold) FL_NOEXCEPT
bool lastResetWasWatchdog() const FL_NOEXCEPT
ResetInfo lastResetInfo() const FL_NOEXCEPT
Detailed reset information including platform raw register + subcause id.
FL_NORETURN void reboot() FL_NOEXCEPT
void clearCrashReport() FL_NOEXCEPT
bool isInSafeMode() const FL_NOEXCEPT
ResetCause
Cause of the previous boot. Call once early in setup().
void(*)(void *user_data) WatchdogTimeoutCallback
ISR-safe C function pointer callback for onTimeout().
@ UNKNOWN
Unknown or unspecified error.
fl::string_view resetCauseName(ResetCause c) FL_NOEXCEPT
Return a static-lifetime name for c — zero-cost, no allocation.
Base definition for an LED controller.
Decoded crash report (Tier 2).
ResetCause cause
Normalized cross-platform enum.
fl::u32 rawRegister
Raw value of the platform's reset-cause register.
fl::string_view causeName() const FL_NOEXCEPT
Cause name (zero-cost, static string_view).
fl::string_view subcauseName() const FL_NOEXCEPT
Platform-specific subcause name (zero-cost, static string_view).
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.
fl::u8 subcauseId
Platform-specific subcause id (0 = none)
Detailed reset information bundling the normalized cause with a platform-specific subcause id and the...