FastLED 3.10.9
Loading...
Searching...
No Matches

◆ waitForDriverCompletion()

bool fl::detail::waitForDriverCompletion ( u32 timeoutMs)

Wait for installed consumers using one deadline (zero means indefinitely).

False reports a consumer error or an exhausted timeout.

Definition at line 31 of file driver_completion_wait.cpp.hpp.

31 {
32 // Snapshot hooks: each singleton registers before accepting submissions.
33 // No backend symbol is referenced from this dispatch implementation.
35 const u32 started = millis();
36 if (hooks.managed && !hooks.managed(timeoutMs)) {
37 return false;
38 }
39 if (!hooks.legacy) {
40 return true;
41 }
42 if (timeoutMs == 0) {
43 return hooks.legacy(0);
44 }
45 const u32 elapsed = millis() - started;
46 if (elapsed >= timeoutMs) {
47 // Never pass zero: the public contract interprets it as infinity.
48 return false;
49 }
50 return hooks.legacy(timeoutMs - elapsed);
51}
static T & instance() FL_NO_EXCEPT
Definition singleton.h:41
fl::u32 millis() FL_NO_EXCEPT
Universal millisecond timer - returns milliseconds since system startup.

References fl::FL_NO_EXCEPT, fl::Singleton< T, N >::instance(), and fl::millis().

Referenced by CFastLED::wait(), and CFastLED::wait().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: