FastLED 3.10.9
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 133 of file FastLED.cpp.hpp.

133 {
134 // Call platform-specific initialization once
135 // Uses the trampoline pattern: platforms/init.h dispatches to platform-specific headers
136 // FL_RUN_ONCE ensures this is only called once, even if init() is called multiple times
137 FL_RUN_ONCE(fl::platforms::init());
138}
#define FL_RUN_ONCE(code)

References FL_NO_EXCEPT, and FL_RUN_ONCE.