Native (no‑hardware) platform used for tests and host builds; may delegate to WASM clockless for browser builds or a generic stub.
fastled_stub.h: Aggregator enabling stub clockless and SPI; definesHAS_HARDWARE_PIN_SUPPORTfor compatibility.clockless_stub.h: Selects between WASM clockless (emscripten) orclockless_stub_generic.hwhenFASTLED_STUB_IMPLis set.
generic/: Generic stub sysdefs/pin helpers used when not targeting WASM.
- Used by C++ unit tests and host builds to provide a hardware‑free implementation. When compiled to WASM, this path can route to the WASM clockless backend for browser visualization.
- The stub platform is the default for C++ unit tests. It provides no‑hardware implementations for pin, SPI, and clockless paths so rendering logic can be validated on hosts.
- Tests that verify export behavior use the
shared/active_strip_datafacilities to snapshot frame/strip data without physical LEDs. - When targeting browser demos, the stub can route to the WASM clockless backend under
emscriptento visualize frames without hardware.
FASTLED_STUB_IMPL: Enable stubbed platform behavior. Default set inled_sysdefs_stub_generic.hwhen targeting stub builds.FASTLED_NO_ARDUINO_STUBS: Disable FastLED's Arduino stub implementations (functions likemillis(),micros(),delay(),pinMode(), etc. and macros likedigitalPinToBitMask,HIGH,LOW, etc.). Use this when integrating with Arduino mock frameworks like ArduinoFake to avoid symbol conflicts. When defined, you must provide these functions/symbols from another library.FASTLED_HAS_MILLIS: Default1.FASTLED_ALLOW_INTERRUPTS: Default1.FASTLED_USE_PROGMEM: Default0.FASTLED_ALL_PINS_HARDWARE_SPI: Declared in stub SPI header for compatibility.- Optional thread helpers:
FASTLED_USE_PTHREAD_DELAY,FASTLED_USE_PTHREAD_YIELDinfluence time/yield behavior intime_stub.cpp.
Define before including FastLED.h to override.
When using ArduinoFake or similar Arduino mock frameworks for testing:
// In your platformio.ini or build flags
#define FASTLED_NO_ARDUINO_STUBS
// Then include ArduinoFake before FastLED
#include <ArduinoFake.h>
#include <FastLED.h>This prevents conflicts between FastLED's stub implementations and ArduinoFake's mock implementations.