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

◆ injectEdges()

virtual bool fl::RxDevice::injectEdges ( fl::span< const EdgeTime > edges)
pure virtual

Manually inject edge timings for testing (Phase 1 - PARLIO gap simulation)

Parameters
edgesSpan of EdgeTime entries to inject (nanosecond timings)
Returns
true on success, false if not supported or failed

This method allows programmatic injection of timing data into RX devices for testing decoder behavior without actual hardware transmission. Primary use case is simulating PARLIO transmission gaps (~20us LOW pulses) to validate gap tolerance in LED decoders.

IMPORTANT: EdgeTime entries must use nanosecond timings, NOT ticks.

  • RMT devices: Will store edges as-is in internal buffer (no tick conversion)
  • GPIO ISR devices: Will store edges directly in timestamp buffer

After injection, use decode() to process the injected edges as if they were captured from hardware.

Example (simulate WS2812B with 20us gap):

rx->begin(config);
// Generate EdgeTime sequence for 3 LEDs
fl::EdgeTime edges[144]; // 3 LEDs × 24 bits × 2 edges/bit
size_t count = generateLedEdges(leds, 3, edges);
// Insert 20us gap (extend last LOW pulse)
edges[count-1].ns += 20000; // Add 20us to last LOW
// Inject edges into RX device
if (rx->injectEdges(edges, count)) {
// Decode injected edges
uint8_t buffer[9]; // 3 LEDs × 3 bytes
auto result = rx->decode(timing, buffer);
}
fl::CRGB leds[NUM_LEDS]
static fl::shared_ptr< RxDevice > create(int pin) FL_NOEXCEPT
Template factory method to create RX device by type.
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31
unsigned char uint8_t
Definition s16x16x4.h:209
u32 ns
Duration in nanoseconds (31 bits, max ~2.1s)
Definition rx.h:35
Universal edge timing representation (platform-agnostic)
Definition rx.h:34
Note
Not all RX devices support injection. DummyRxDevice returns false.

Referenced by fl::shared_ptr< RxDevice >.

+ Here is the caller graph for this function: