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

◆ instance()

ChannelManager & fl::ChannelManager::instance ( )
static

Get the global singleton instance.

Returns
Reference to the singleton ChannelManager
Note
Thread-safe singleton initialization

The first call registers the platform's default channel drivers (platforms::initChannelDrivers()). Runtime-selection callers (FastLED.add(cfg), driver queries, Channel dispatch) use this.

Definition at line 25 of file manager.cpp.hpp.

25 {
26 auto& out = registry();
27 // Lazy initialization of platform-specific channel drivers
28 // C++11 guarantees thread-safe static initialization
29 static bool sInitialized = false; // okay static in header
30 if (!sInitialized) {
31 sInitialized = true;
32 platforms::initChannelDrivers();
33 }
34 return out;
35}
static ChannelManager & registry() FL_NO_EXCEPT
Get the singleton WITHOUT registering platform default drivers.

References ChannelManager(), and registry().

Referenced by fl::channelManager(), fl::Channel::resolveDynamicDriver(), fl::Channel::submitFrame(), and DriverTestRunner::testSingleDriver().

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