FastLED 3.9.15
Loading...
Searching...
No Matches

◆ loop()

void loop ( )

Definition at line 116 of file Loopback.ino.

116 {
117 // Pump async task queue (async fetch tasks + server)
119
120 // State: WAITING_FOR_TESTS -> wait 1 second after startup -> start tests
121 if (state == WAITING_FOR_TESTS && (fl::millis() - startup_time > 1000)) {
122 // Start test sequence with completion callback
123 testRunner.startTests([](bool success, int passed, int total) {
124 // Called when all tests complete
126 server.stop();
127 });
129 }
130
131 // Update test runner state machine (advances tests, processes callbacks)
132 if (state == TESTS_RUNNING) {
133 testRunner.update();
134 }
135
136
137 if (state == ALL_PASSED || state == FAILED) {
138 updateLEDs();
139 FastLED.show();
140 delay(100);
141 return; // Stay in terminal state, let the framework break from this test.
142 }
143
144 // Update LED feedback and show
145 updateLEDs();
146 FastLED.show();
147
148 // Small delay allows async promise callbacks to process
149 // On WASM, delay() automatically pumps async tasks every 1ms
150 delay(10);
151}
fl::HttpServer server
TestState state
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
LoopbackTestRunner testRunner
Definition Loopback.ino:39
void updateLEDs()
Definition Loopback.ino:54
@ WAITING_FOR_TESTS
Definition Loopback.ino:44
@ TESTS_RUNNING
Definition Loopback.ino:45
uint32_t startup_time
Definition Loopback.ino:51
void run(fl::u32 microseconds, ExecFlags flags)
Run selected task subsystems.
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.
void delay(u32 ms, bool run_async=true) FL_NOEXCEPT
Public delay wrapper that keeps bare Arduino delay() preferred after using fl::delay; while still all...
Definition delay.h:98

References ALL_PASSED, FAILED, FastLED, fl::millis(), fl::task::run(), server, startup_time, state, testRunner, TESTS_RUNNING, updateLEDs(), and WAITING_FOR_TESTS.

+ Here is the call graph for this function: