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

◆ remove() [1/2]

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

Remove a channel from the LED controller list.

Removes the channel from the active controller list so it will no longer be updated by FastLED.show(). The channel object itself remains valid and can be re-added later if needed.

Parameters
channelShared pointer to a Channel instance
Note
Safe to call multiple times - no error if channel not in list
The channel object is not destroyed, only removed from the list

Example:

auto channel = FastLED.add(config);
// ... use channel ...
FastLED.remove(channel); // Remove from controller list
CFastLED FastLED
Global LED strip management instance.

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

151 {
152 if (!channel) {
153 return;
154 }
155 // Note: removeFromDrawList() now fires onChannelRemoved event
156 channel->removeFromDrawList();
157 // Remove from internal storage (safe if not found - erase is a no-op)
158 channels().erase(channel);
159}
static fl::vector< fl::ChannelPtr > & channels()
stored ChannelPtrs to keep them alive

References channels().

Referenced by clear().

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