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

◆ ScopedWatchdog() [2/3]

fl::ScopedWatchdog::ScopedWatchdog ( fl::u32 timeout_ms)
explicit

Construct with an explicit timeout.

Same semantics as the default constructor — first-call init, feed on construction.

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

200 {
201 static bool sInitialized = false;
202 if (!sInitialized) {
203 sInitialized = true;
205 }
206
207 // Single-instance enforcement. A second simultaneously-alive ScopedWatchdog
208 // is almost always a bug — the timeout argument here was silently ignored
209 // (only the first instance gets to arm the WDT). Warn once per process so
210 // the developer notices, but still feed so the program survives.
212 if (count >= 1) {
213 static bool sWarnedOnce = false;
214 if (!sWarnedOnce) {
215 sWarnedOnce = true;
217 "[FastLED.watchdog] WARN: nested FL_WATCHDOG_AUTO() detected — "
218 "only one scoped guard should be alive at a time"));
219 }
220 }
221 ++count;
222
224}
static Watchdog & instance() FL_NO_EXCEPT
void feed() FL_NO_EXCEPT
void scopedWatchdogPrintLine(fl::string_view sv) FL_NO_EXCEPT
void scopedWatchdogFirstInit(fl::u32 timeout_ms) FL_NO_EXCEPT
int & scopedWatchdogActiveCount() FL_NO_EXCEPT

References fl::Watchdog::feed(), fl::FL_NO_EXCEPT, fl::Watchdog::instance(), fl::platforms::scopedWatchdogActiveCount(), fl::platforms::scopedWatchdogFirstInit(), and fl::platforms::scopedWatchdogPrintLine().

+ Here is the call graph for this function: