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

◆ wave3Untranspose_16()

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

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

261 {
262 Wave3Byte lane_waves[16];
263
264 for (int symbol_idx = 0; symbol_idx < 3; symbol_idx++) {
265 u8 lane_bytes[16] = {0};
266
267 for (int pulse_idx = 0; pulse_idx < 8; pulse_idx++) {
268 int pulse_bit = 7 - pulse_idx;
269 int input_offset = symbol_idx * 16 + pulse_idx * 2;
270 u16 input_word = (u16)transposed[input_offset] |
271 ((u16)transposed[input_offset + 1] << 8);
272
273 for (int lane = 0; lane < 16; lane++) {
274 u8 pulse = (input_word >> lane) & 1;
275 lane_bytes[lane] |= (pulse << pulse_bit);
276 }
277 }
278
279 for (int lane = 0; lane < 16; lane++) {
280 lane_waves[lane].data[symbol_idx] = lane_bytes[lane];
281 }
282 }
283
284 for (int lane = 0; lane < 16; lane++) {
285 fl::isr::memcopy(output + lane * sizeof(Wave3Byte), &lane_waves[lane], sizeof(Wave3Byte));
286 }
287}
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: