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

◆ wave8Untranspose_8()

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

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

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

+ Here is the call graph for this function: