380 {
381
382
383
384
385 Wave8Byte lane_waves[4];
386
387
388 for (int symbol_idx = 0; symbol_idx < 8; symbol_idx++) {
389 u8 lane_bytes[4] = {0, 0, 0, 0};
390
391
392 for (int byte_idx = 0; byte_idx < 4; byte_idx++) {
393 u8 input_byte = transposed[symbol_idx * 4 + byte_idx];
394
395
396 int pulse_bit_hi = 7 - (byte_idx * 2);
397 int pulse_bit_lo = pulse_bit_hi - 1;
398
399
400
401 for (int lane = 0; lane < 4; lane++) {
402
403 u8 pulse_hi = (input_byte >> (4 + lane)) & 1;
404 u8 pulse_lo = (input_byte >> lane) & 1;
405
406
407 lane_bytes[lane] |= (pulse_hi << pulse_bit_hi);
408 lane_bytes[lane] |= (pulse_lo << pulse_bit_lo);
409 }
410 }
411
412
413 for (int lane = 0; lane < 4; lane++) {
414 lane_waves[lane].symbols[symbol_idx].data = lane_bytes[lane];
415 }
416 }
417
418
419 for (int lane = 0; lane < 4; lane++) {
420 fl::isr::memcopy(output + lane *
sizeof(Wave8Byte), &lane_waves[lane],
sizeof(Wave8Byte));
421 }
422}
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.