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

◆ wave3Untranspose_2()

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

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

168 {
169 Wave3Byte lane_waves[2];
170
171 for (int symbol_idx = 0; symbol_idx < 3; symbol_idx++) {
172 u16 interleaved = ((u16)transposed[symbol_idx * 2] << 8) |
173 transposed[symbol_idx * 2 + 1];
174
175 u8 lane0_bits = 0;
176 u8 lane1_bits = 0;
177
178 for (int bit = 0; bit < 8; bit++) {
179 if (interleaved & (1 << (bit * 2 + 1))) {
180 lane0_bits |= (1 << bit);
181 }
182 if (interleaved & (1 << (bit * 2))) {
183 lane1_bits |= (1 << bit);
184 }
185 }
186
187 lane_waves[0].data[symbol_idx] = lane0_bits;
188 lane_waves[1].data[symbol_idx] = lane1_bits;
189 }
190
191 fl::isr::memcpy(output, &lane_waves[0], sizeof(Wave3Byte));
192 fl::isr::memcpy(output + sizeof(Wave3Byte), &lane_waves[1], sizeof(Wave3Byte));
193}
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: