FastLED 3.10.8
Loading...
Searching...
No Matches

◆ add() [5/9]

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
CRGB * leds() FL_NO_EXCEPT
Get a pointer to led data for the first controller.
constexpr EOrder RGB
Definition eorder.h:17
CFastLED FastLED
Global LED strip management instance.
constexpr ChipsetTimingConfig makeTimingConfig() FL_NO_EXCEPT
Convert compile-time CHIPSET type to runtime timing config.
Configuration for a single LED channel.
Definition config.h:167

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

212 {
213 if (!channel) {
214 return;
215 }
216 auto& chnls = channels();
217 // Protect against double-add
218 if (chnls.has(channel)) {
219 return;
220 }
221 chnls.push_back(channel);
222 // Add channel to the CLEDController linked list
223 // fl::Channel uses DeferRegister mode, so explicit addToDrawList() call is required
224 // Note: addToDrawList() now fires onChannelAdded event
225 channel->addToDrawList();
226}
static fl::vector< fl::ChannelPtr > & channels() FL_NO_EXCEPT
stored ChannelPtrs to keep them alive

References fl::Channel::addToDrawList(), channels(), and FL_NO_EXCEPT.

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

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