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

Function initChannelDrivers

src/platforms/wasm/init_channel_driver.h:23–34  ·  view source on GitHub ↗

@brief Initialize channel drivers for WASM platform Registers the stub channel driver with the ChannelManager. WASM uses stub driver because there's no real hardware in browser. This allows the legacy API to work with channel drivers in web builds.

Source from the content-addressed store, hash-verified

21/// WASM uses stub driver because there's no real hardware in browser.
22/// This allows the legacy API to work with channel drivers in web builds.
23inline void initChannelDrivers() FL_NOEXCEPT {
24 fl::ChannelManager& manager = fl::ChannelManager::instance();
25
26 // Get the stub driver singleton
27 auto* stubEngine = fl::getStubChannelEngine();
28
29 // Wrap it in a shared_ptr without taking ownership
30 auto sharedStub = fl::make_shared_no_tracking(*stubEngine);
31
32 // Register with low priority (stub is a fallback/testing driver)
33 manager.addDriver(0, sharedStub);
34}
35
36} // namespace platforms
37} // namespace fl

Callers 2

initFunction · 0.70
manager.cpp.hppFile · 0.50

Calls 3

getStubChannelEngineFunction · 0.85
make_shared_no_trackingFunction · 0.85
addDriverMethod · 0.80

Tested by

no test coverage detected