FastLED 3.9.15
Loading...
Searching...
No Matches
SketchHalt Class Reference

Detailed Description

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; } }

Examples
RX.ino.

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
 

The documentation for this class was generated from the following file: