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

◆ add() [4/8]

void CFastLED::add ( fl::ChannelPtr channel)
static

Add a Channel-based LED controller (from ChannelPtr)

Registers a pre-created Channel instance with the FastLED controller list. Channels provide hardware-accelerated parallel LED output using platform-specific drivers.

Parameters
channelShared pointer to a Channel instance

Example:

fl::ChannelPtr channel = fl::Channel::create(config);
FastLED.add(channel);
#define NUM_LEDS
#define PIN_DATA
CFastLED FastLED
Global LED strip management instance.
CRGB * leds()
Get a pointer to led data for the first controller.
constexpr EOrder RGB
Definition eorder.h:17
constexpr ChipsetTimingConfig makeTimingConfig() FL_NOEXCEPT
Convert compile-time CHIPSET type to runtime timing config.
Configuration for a single LED channel.
Definition config.h:163

Definition at line 135 of file FastLED.cpp.hpp.

135 {
136 if (!channel) {
137 return;
138 }
139 auto& chnls = channels();
140 // Protect against double-add
141 if (chnls.has(channel)) {
142 return;
143 }
144 chnls.push_back(channel);
145 // Add channel to the CLEDController linked list
146 // Channel uses DeferRegister mode, so explicit addToDrawList() call is required
147 // Note: addToDrawList() now fires onChannelAdded event
148 channel->addToDrawList();
149}
static fl::vector< fl::ChannelPtr > & channels()
stored ChannelPtrs to keep them alive

References channels().

Referenced by add(), add(), add(), and add().

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