FastLED 3.9.15
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 154 of file watchdog.cpp.hpp.

154 {
155 static bool sInitialized = false;
156 if (!sInitialized) {
157 sInitialized = true;
159 }
160
161 // Single-instance enforcement. A second simultaneously-alive ScopedWatchdog
162 // is almost always a bug — the timeout argument here was silently ignored
163 // (only the first instance gets to arm the WDT). Warn once per process so
164 // the developer notices, but still feed so the program survives.
166 if (count >= 1) {
167 static bool sWarnedOnce = false;
168 if (!sWarnedOnce) {
169 sWarnedOnce = true;
171 "[FastLED.watchdog] WARN: nested FL_WATCHDOG_AUTO() detected — "
172 "only one scoped guard should be alive at a time"));
173 }
174 }
175 ++count;
176
178}
static Watchdog & instance() FL_NOEXCEPT
void feed() FL_NOEXCEPT
void scopedWatchdogFirstInit(fl::u32 timeout_ms) FL_NOEXCEPT
int & scopedWatchdogActiveCount() FL_NOEXCEPT
void scopedWatchdogPrintLine(fl::string_view sv) FL_NOEXCEPT

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

+ Here is the call graph for this function: