39 static const char hex[] =
"0123456789abcdef";
40 for (
int i = 7; i >= 0; --i) {
41 tmp[2 + (7 - i)] =
hex[(
value >> (i * 4)) & 0xFu];
43 fl::size n = (out.size() < 10) ? out.size() : 10;
44 for (fl::size i = 0; i < n; ++i) out[i] = tmp[i];
50 fl::size n = (out.size() < sv.size()) ? out.size() : sv.size();
51 for (fl::size i = 0; i < n; ++i) out[i] = sv[i];
56 if (out.size() == 0)
return 0;
62 if (written < out.size()) out[written] =
'\0';
75 if (sub.
size() != 0) {
122 static int count = 0;
131 wdt.
begin(timeout_ms);
155 static bool sInitialized =
false;
167 static bool sWarnedOnce =
false;
171 "[FastLED.watchdog] WARN: nested FL_WATCHDOG_AUTO() detected — "
172 "only one scoped guard should be alive at a time"));
182 if (count > 0) --count;
static int activeScopeCount() FL_NOEXCEPT
Observability: number of simultaneously-alive ScopedWatchdog instances.
~ScopedWatchdog() FL_NOEXCEPT
Feed the watchdog at end-of-scope so the next loop() iteration has a clean deadline window.
ScopedWatchdog() FL_NOEXCEPT
Default construct with the library default timeout (15 000 ms).
static Watchdog & instance() FL_NOEXCEPT
void begin(fl::u32 timeout_ms) FL_NOEXCEPT
bool hasCrashReport() const FL_NOEXCEPT
ResetCause lastResetCause() const FL_NOEXCEPT
ResetInfo lastResetInfo() const FL_NOEXCEPT
Detailed reset information including platform raw register + subcause id.
Unified cross-platform watchdog interface.
constexpr fl::size size() const FL_NOEXCEPT
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::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...
Unified cross-platform Watchdog Timer API for FastLED.