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

◆ wave3Untranspose_2()

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

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

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