MCPcopy Create free account
hub / github.com/FastLED/FastLED / check

Method check

examples/RX/SketchHalt.h:32–44  ·  view source on GitHub ↗

@brief Check if sketch is halted and handle periodic message printing @return true if halted (caller should return from loop immediately) This should be the FIRST line in loop(): if (halt.check()) return;

Source from the content-addressed store, hash-verified

30 /// This should be the FIRST line in loop():
31 /// if (halt.check()) return;
32 bool check() {
33 if (!mHalted) {
34 return false;
35 }
36
37 fl::u32 current_time = fl::millis();
38 if (mLastPrintTime == 0 || (current_time - mLastPrintTime) >= 5000) {
39 fl::cout << "ERROR: HALT: " << mMessage.c_str() << "\n";
40 mLastPrintTime = current_time;
41 }
42 fl::delayMillis(100);
43 return true;
44 }
45
46 /// @brief Halt sketch execution with an error message
47 void error(const char* message) {

Callers

nothing calls this directly

Calls 3

delayMillisFunction · 0.85
millisFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected