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

Class PollNeededCallback

src/fl/channels/driver.h:58–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56 /// means the manager should wake and poll. Drivers that do not have such a
57 /// signal leave this unused; the manager's timed wait slice is the fallback.
58 struct PollNeededCallback {
59 using Callback = void (*)(void*) FL_NOEXCEPT;
60
61 Callback callback = nullptr;
62 void* context = nullptr;
63
64 constexpr PollNeededCallback() FL_NOEXCEPT = default;
65 constexpr PollNeededCallback(Callback cb, void* ctx) FL_NOEXCEPT
66 : callback(cb), context(ctx) {}
67
68 bool isValid() const FL_NOEXCEPT { return callback != nullptr; }
69 explicit operator bool() const FL_NOEXCEPT { return isValid(); }
70
71 void invoke() const FL_NOEXCEPT {
72 if (callback != nullptr) {
73 callback(context);
74 }
75 }
76 };
77
78 /// @brief ISR-safe storage for a poll-needed callback handle.
79 ///

Callers 4

manager.cpp.hppFile · 0.85
addDriverMethod · 0.85
removeDriverMethod · 0.85
clearAllDriversMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected