|
FastLED 3.9.15
|
Sketch halting mechanism that prevents watchdog timer resets.
Instead of using an infinite while(1) loop (which blocks loop() from returning and triggers watchdog resets on ESP32-C6), this class uses a flag-based approach that allows loop() to return normally.
Usage: SketchHalt halt;
void loop() { if (halt.check()) return; // MUST be first line // ... rest of loop code if (test_failed) { halt.error("Test failed"); return; } }
Definition at line 25 of file SketchHalt.h.
#include <SketchHalt.h>
Collaboration diagram for SketchHalt:Public Member Functions | |
| bool | check () |
| Check if sketch is halted and handle periodic message printing. | |
| void | error (const char *message) |
| Halt sketch execution with an error message. | |
Private Attributes | |
| bool | mHalted = false |
| fl::u32 | mLastPrintTime = 0 |
| fl::string | mMessage |