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

◆ wave3Untranspose_8()

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

Definition at line 228 of file wave3.cpp.hpp.

229 {
230 Wave3Byte lane_waves[8];
231
232 for (int symbol_idx = 0; symbol_idx < 3; symbol_idx++) {
233 u8 lane_bytes[8] = {0, 0, 0, 0, 0, 0, 0, 0};
234
235 // After transpose+reversal: byte 0 = bit 7 (first pulse, MSB),
236 // byte 7 = bit 0 (last pulse, LSB)
237 for (int byte_idx = 0; byte_idx < 8; byte_idx++) {
238 u8 input_byte = transposed[symbol_idx * 8 + byte_idx];
239 // byte 0 = bit 7, byte 7 = bit 0 (reversed order)
240 int pulse_bit = 7 - byte_idx;
241
242 for (int lane = 0; lane < 8; lane++) {
243 u8 pulse = (input_byte >> lane) & 1;
244 lane_bytes[lane] |= (pulse << pulse_bit);
245 }
246 }
247
248 for (int lane = 0; lane < 8; lane++) {
249 lane_waves[lane].data[symbol_idx] = lane_bytes[lane];
250 }
251 }
252
253 for (int lane = 0; lane < 8; lane++) {
254 fl::isr::memcpy(output + lane * sizeof(Wave3Byte), &lane_waves[lane], sizeof(Wave3Byte));
255 }
256}
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
u8 data[3]
Definition wave3.h:21
Type-safe container for 3-byte wave pulse pattern (wave3 encoding)
Definition wave3.h:20

References fl::Wave3Byte::data, FL_RESTRICT_PARAM, and fl::isr::memcpy().

+ Here is the call graph for this function: