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

◆ wave3Untranspose_8()

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

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

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

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

+ Here is the call graph for this function: