@brief Initialize WebAssembly platform Performs one-time initialization of WASM-specific subsystems. This function uses a static flag to ensure initialization happens only once.
| 28 | /// Performs one-time initialization of WASM-specific subsystems. |
| 29 | /// This function uses a static flag to ensure initialization happens only once. |
| 30 | void init() { |
| 31 | static bool initialized = false; |
| 32 | |
| 33 | if (initialized) { |
| 34 | return; // Already initialized |
| 35 | } |
| 36 | |
| 37 | FL_DBG("WASM: Platform initialization starting"); |
| 38 | |
| 39 | // Initialize driver listener system |
| 40 | // This connects FastLED driver events to the JavaScript runtime |
| 41 | EngineListener::Init(); |
| 42 | |
| 43 | // Initialize channel drivers for WASM platform |
| 44 | // This registers the stub driver with ChannelManager |
| 45 | platforms::initChannelDrivers(); |
| 46 | |
| 47 | initialized = true; |
| 48 | FL_DBG("WASM: Platform initialization complete"); |
| 49 | } |
| 50 | |
| 51 | } // namespace platforms |
| 52 | } // namespace fl |
no test coverage detected