FastLED 3.9.15
Loading...
Searching...
No Matches

◆ init()

void CFastLED::init ( )

Initialize platform-specific subsystems.

Performs one-time initialization of platform-specific hardware and subsystems. This is called automatically on first use but can be called explicitly to ensure initialization happens at a predictable time.

Safe to call multiple times - subsequent calls are no-ops.

Platform-specific initialization:

  • ESP32: Initializes channel bus manager (PARLIO/SPI/RMT/UART) and SPI bus manager
  • Other platforms: No-op (no initialization required)

Definition at line 103 of file FastLED.cpp.hpp.

103 {
104 // Call platform-specific initialization once
105 // Uses the trampoline pattern: platforms/init.h dispatches to platform-specific headers
106 // FL_RUN_ONCE ensures this is only called once, even if init() is called multiple times
107 FL_RUN_ONCE(fl::platforms::init());
108}
#define FL_RUN_ONCE(code)

References FL_RUN_ONCE.