MCPcopy Create free account
hub / github.com/FastLED/FastLED / initChannelDrivers

Function initChannelDrivers

src/platforms/shared/init_channel_driver.h:24–38  ·  view source on GitHub ↗

@brief Initialize channel drivers (registers stub driver for non-hardware platforms) For platforms without hardware-specific channel drivers (stub, posix, tests), this registers the stub driver as a fallback. This allows the legacy API to work and enables LED capture for testing.

Source from the content-addressed store, hash-verified

22/// this registers the stub driver as a fallback. This allows the legacy API to work
23/// and enables LED capture for testing.
24inline void initChannelDrivers() FL_NOEXCEPT {
25 // Register the stub channel driver (low priority fallback)
26 // This allows tests and unsupported platforms to use the channel API
27 fl::ChannelManager& manager = fl::ChannelManager::instance();
28
29 // Get the stub driver singleton
30 auto* stubEngine = fl::getStubChannelEngine();
31
32 // Wrap it in a shared_ptr without taking ownership using make_shared_no_tracking
33 // This is a zero-overhead wrapper that doesn't create a control block
34 auto sharedStub = fl::make_shared_no_tracking(*stubEngine);
35
36 // Register with low priority so platform-specific drivers can override
37 manager.addDriver(0, sharedStub);
38}
39
40} // namespace platforms
41} // namespace fl

Callers

nothing calls this directly

Calls 3

getStubChannelEngineFunction · 0.85
make_shared_no_trackingFunction · 0.85
addDriverMethod · 0.80

Tested by

no test coverage detected