FastLED 3.10.10
Loading...
Searching...
No Matches

◆ add() [7/11]

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() FL_NO_EXCEPT
Get a pointer to led data for the first controller.
constexpr EOrder RGB
Definition eorder.h:17
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 220 of file FastLED.cpp.hpp.

220 {
221 if (!channel) {
222 return;
223 }
224 auto& chnls = channels();
225 // Protect against double-add
226 if (chnls.has(channel)) {
227 return;
228 }
229 chnls.push_back(channel);
230 // Add channel to the CLEDController linked list
231 // fl::Channel uses DeferRegister mode, so explicit addToDrawList() call is required
232 // Note: addToDrawList() now fires onChannelAdded event
233 channel->addToDrawList();
234}
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(), add(), and addLeds().

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