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

◆ enableDrivers()

template<Bus... Buses>
void fl::enableDrivers ( )
inline

Register the named drivers with ChannelManager for runtime selection.

Each named bus's BusTraits<B>::registerWithManager() is invoked, which:

  1. Lazily constructs the driver singleton (links its translation unit).
  2. Calls ChannelManager::addDriver(priority, instance) so the runtime manager can route channels to it.

Pre-condition: the per-driver bus_traits.h for each B named here must be reachable from the calling translation unit. Including the per-platform driver headers brings the relevant specializations in. Naming a Bus whose BusTraits<B> specialization is not visible produces a clear "implicit instantiation of undefined template" diagnostic.

#include "platforms/esp/32/drivers/rmt/rmt_5/bus_traits.h"
#include "platforms/esp/32/drivers/parlio/bus_traits.h"
fl::enableDriver<fl::Bus::FLEX_IO, 0>(); // PARLIO/LCD_CAM/etc. slot
void enableDriver() FL_NO_EXCEPT
Definition bus_traits.h:88

Definition at line 81 of file bus_traits.h.

81 {
82 // C++11-compatible pack expansion via array initializer trick.
83 using expand = int[];
84 (void)expand{0, detail::bus_register_one<Buses>()...};
85}
int bus_register_one() FL_NO_EXCEPT
Helper used by enableDrivers<Bus...>() to expand the parameter pack.
Definition bus_traits.h:55

References fl::detail::bus_register_one(), and FL_NO_EXCEPT.

+ Here is the call graph for this function: