FastLED 3.10.10
Loading...
Searching...
No Matches
driver_bindings.cpp.hpp
Go to the documentation of this file.
1// IWYU pragma: private
2
4
5#include "fl/stl/singleton.h"
6
7namespace fl {
8
12
14 if (node.listed) {
15 return;
16 }
17 node.listed = true;
18 node.next = mHead;
19 mHead = &node;
20}
21
23 bool matched = false;
24 for (DriverBinding* node = mHead; node != nullptr; node = node->next) {
25 if (bus != Bus::AUTO && (node->bus != bus || node->which != which)) {
26 continue;
27 }
28 matched = true;
29 // Registration deduplicates by name, so binding again is cheap and
30 // re-registers a driver a cleared manager dropped.
31 node->bind();
32 }
33 return matched;
34}
35
36} // namespace fl
DriverBinding * mHead
void push(DriverBinding &node) FL_NO_EXCEPT
Self-add a node. Idempotent: a node already listed is ignored.
bool bind(Bus bus, u8 which) FL_NO_EXCEPT
Bind (register) every node matching bus/which, or every node when bus is Bus::AUTO.
static DriverBindings & instance() FL_NO_EXCEPT
Process-wide list of enabled buses.
static T & instance() FL_NO_EXCEPT
Definition singleton.h:41
Opt-in, link-on-use channel driver bindings for FastLED.add(cfg).
unsigned char u8
Definition stdint.h:132
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
Bus
Portable public bus selector.
Definition bus.h:31
@ AUTO
Definition bus.h:32
Base definition for an LED controller.
One enabled bus. Static storage, linked intrusively; never heap.