FastLED 3.10.8
Loading...
Searching...
No Matches

◆ wave8Untranspose_8()

void fl::wave8Untranspose_8 ( const u8(&) transposed[8 *sizeof(Wave8Byte)],
u8(&) output[8 *sizeof(Wave8Byte)] )

Definition at line 425 of file wave8.cpp.hpp.

426 {
427 // Reverse the 8-lane transposition
428 // Input: 64 bytes of interleaved data (8 bytes per symbol, 8 symbols)
429 // Output: 8 Wave8Byte structures (64 bytes total, de-interleaved)
430
431 Wave8Byte lane_waves[8];
432
433 // Process each of the 8 symbols
434 for (int symbol_idx = 0; symbol_idx < 8; symbol_idx++) {
435 u8 lane_bytes[8] = {0, 0, 0, 0, 0, 0, 0, 0};
436
437 // Process 8 input bytes (1 pulse per byte)
438 // After transpose+reversal: byte 0 = bit 7 (first pulse, MSB),
439 // byte 7 = bit 0 (last pulse, LSB)
440 for (int byte_idx = 0; byte_idx < 8; byte_idx++) {
441 u8 input_byte = transposed[symbol_idx * 8 + byte_idx];
442
443 // Calculate which pulse bit this corresponds to
444 // byte 0 = bit 7, byte 7 = bit 0 (reversed order)
445 int pulse_bit = 7 - byte_idx;
446
447 // De-interleave 8 lanes from this byte
448 // Bit layout: [L7, L6, L5, L4, L3, L2, L1, L0]
449 for (int lane = 0; lane < 8; lane++) {
450 // Extract bit for this lane (lane 0 = LSB, lane 7 = MSB)
451 u8 pulse = (input_byte >> lane) & 1;
452
453 // Reconstruct lane byte
454 lane_bytes[lane] |= (pulse << pulse_bit);
455 }
456 }
457
458 // Store de-interleaved bytes
459 for (int lane = 0; lane < 8; lane++) {
460 lane_waves[lane].symbols[symbol_idx].data = lane_bytes[lane];
461 }
462 }
463
464 // Copy de-interleaved data to output
465 for (int lane = 0; lane < 8; lane++) {
466 fl::isr::memcopy(output + lane * sizeof(Wave8Byte), &lane_waves[lane], sizeof(Wave8Byte));
467 }
468}
unsigned char u8
Definition stdint.h:131
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memcopy(void *FL_RESTRICT_PARAM dst, const void *FL_RESTRICT_PARAM src, size_t num_bytes)
ISR-optimized memcpy with alignment detection and switch dispatch.
Definition memcpy.h:75
unsigned char u8
Definition stdint.h:131

References FL_NO_EXCEPT, FL_RESTRICT_PARAM, and fl::isr::memcopy().

+ Here is the call graph for this function: