40 static const char hex[] =
"0123456789abcdef";
41 for (
int i = 7; i >= 0; --i) {
42 tmp[2 + (7 - i)] =
hex[(
value >> (i * 4)) & 0xFu];
44 fl::size n = (out.size() < 10) ? out.size() : 10;
45 for (fl::size i = 0; i < n; ++i) out[i] = tmp[i];
51 fl::size n = (out.size() < sv.size()) ? out.size() : sv.size();
52 for (fl::size i = 0; i < n; ++i) out[i] = sv[i];
57 if (out.size() == 0)
return 0;
63 if (written < out.size()) out[written] =
'\0';
76 if (sub.
size() != 0) {
145 info.rawRegister = 0;
168 static int count = 0;
177 wdt.
begin(timeout_ms);
201 static bool sInitialized =
false;
213 static bool sWarnedOnce =
false;
217 "[FastLED.watchdog] WARN: nested FL_WATCHDOG_AUTO() detected — "
218 "only one scoped guard should be alive at a time"));
228 if (count > 0) --count;
~ScopedWatchdog() FL_NO_EXCEPT
Feed the watchdog at end-of-scope so the next loop() iteration has a clean deadline window.
ScopedWatchdog() FL_NO_EXCEPT
Default construct with the library default timeout (15 000 ms).
static int activeScopeCount() FL_NO_EXCEPT
Observability: number of simultaneously-alive ScopedWatchdog instances.
static Watchdog & instance() FL_NO_EXCEPT
bool shouldEscapeToBootloader() const FL_NO_EXCEPT
True when the escape is enabled and the board has hit the consecutive-watchdog-reset threshold.
fl::u16 bootloaderEscapeThreshold() const FL_NO_EXCEPT
Boot-loop escape hatch: drop to the bootloader instead of looping forever, so an unattended host can ...
fl::u32 bootGuardCount() const FL_NO_EXCEPT
Early-boot loop guard counter (see fl/wdt/boot_guard.h): consecutive boots since the last markBootHea...
void begin(fl::u32 timeout_ms) FL_NO_EXCEPT
void markBootHealthy() FL_NO_EXCEPT
Tell the early-boot guard this boot is healthy, zeroing its counter.
void setBootloaderEscapeThreshold(fl::u16 threshold) FL_NO_EXCEPT
Set the consecutive-watchdog-reset count that triggers the escape.
fl::u16 mBootloaderEscapeThreshold
ResetInfo lastResetInfo() const FL_NO_EXCEPT
Detailed reset information including platform raw register + subcause id.
fl::u16 consecutiveCrashCount() const FL_NO_EXCEPT
ResetCause lastResetCause() const FL_NO_EXCEPT
bool hasCrashReport() const FL_NO_EXCEPT
bool escapeToBootloaderIfLooping() FL_NO_EXCEPT
Reboot into the bootloader if this looks like a boot loop.
bool rebootIntoBootloader() FL_NO_EXCEPT
Unified cross-platform watchdog interface.
constexpr fl::size size() const FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
constexpr int type_rank< T >::value
Base definition for an LED controller.
ResetCause cause
Normalized cross-platform enum.
fl::u32 rawRegister
Raw value of the platform's reset-cause register.
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.
fl::string_view subcauseName() const FL_NO_EXCEPT
Platform-specific subcause name (zero-cost, static string_view).
fl::string_view causeName() const FL_NO_EXCEPT
Cause name (zero-cost, static string_view).
fl::u8 subcauseId
Platform-specific subcause id (0 = none)
Detailed reset information bundling the normalized cause with a platform-specific subcause id and the...
Unified cross-platform Watchdog Timer API for FastLED.