FastLED 3.10.6
Loading...
Searching...
No Matches

◆ setExclusiveDriver() [1/2]

template<fl::Bus B, fl::u8 Which>
void fl::ChannelManager::setExclusiveDriver ( )
inline

Register a single driver at a priority above the platform default and disable all others (compile-time TU-linking variant).

Post-#2428 the default build does NOT auto-register every driver – only the platform-default driver TU links (via the legacy clockless addLeds<>() controller's fl::SlimBridgeController registration). This template provides the opt-in path to add another driver and have it win priority dispatch.

Naming BusTraits<B>::instancePtr() here is the ODR-use that links the driver TU; the registration with the manager happens at kExclusivePriority (a value above any platform default) so the new driver wins in selectDriverForChannel().

Template Parameters
BBus identifier (must have a BusTraits<B> specialization visible at the call site).
Note
Must be called before addLeds<> / FastLED.add() so newly-constructed channels see the override during driver resolution. Legacy clockless addLeds<>() controllers route through fl::SlimBridgeController<...>, whose driver is fixed at compile time by its DriverTraits template parameter and registered with ChannelManager in the constructor – this template does not rewrite already-constructed controllers.

Definition at line 356 of file manager.h.

356 {
357 // Priority above any platform default — see `bus_priorities.h` for the
358 // default-priority constants (highest there is ~10 for native LCD/I2S SPI).
359 constexpr int kExclusivePriority = 10000;
360 addDriver(kExclusivePriority, fl::BusTraits<B, Which>::instancePtr());
361}
void addDriver(int priority, fl::shared_ptr< IChannelDriver > driver) FL_NO_EXCEPT
Add a driver with priority (higher priority = preferred)

References ChannelManager(), addDriver(), fl::FL_NO_EXCEPT, and setExclusiveDriver().

Referenced by CFastLED::setExclusiveDriver(), CFastLED::setExclusiveDriver(), and setExclusiveDriver().

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