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

◆ setDriver()

void fl::Channel::setDriver ( fl::shared_ptr< IChannelDriver > driver)
inlineprotected

Pre-bind a driver, bypassing ChannelManager::selectDriverForChannel() on every subsequent showPixels() call.

Used by legacy addLeds<>-style controllers (e.g. ClocklessIdf5) to route directly to a BusTraits<DefaultBus>::instancePtr() singleton at construction time. Post-#2428 this is the mechanism that lets --gc-sections drop unreferenced driver TUs from default builds (Phase 5b — the binary-size fix for #2420 / #2421).

Note
Stored as weak_ptr to avoid holding the driver alive past the caller's intent. The caller (typically the static singleton in a BusTraits) owns the strong reference.

Definition at line 226 of file channel.h.

226 {
227 mDriver = driver;
228 mDriverPreBound = true;
229 }
bool mDriverPreBound
Definition channel.h:257
fl::weak_ptr< IChannelDriver > mDriver
Definition channel.h:256

References FL_NOEXCEPT, mDriver, and mDriverPreBound.