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

◆ wave3Untranspose_4()

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

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

198 {
199 Wave3Byte lane_waves[4];
200
201 for (int symbol_idx = 0; symbol_idx < 3; symbol_idx++) {
202 u8 lane_bytes[4] = {0, 0, 0, 0};
203
204 for (int byte_idx = 0; byte_idx < 4; byte_idx++) {
205 u8 input_byte = transposed[symbol_idx * 4 + byte_idx];
206
207 int pulse_bit_hi = 7 - (byte_idx * 2);
208 int pulse_bit_lo = pulse_bit_hi - 1;
209
210 for (int lane = 0; lane < 4; lane++) {
211 u8 pulse_hi = (input_byte >> (4 + lane)) & 1;
212 u8 pulse_lo = (input_byte >> lane) & 1;
213 lane_bytes[lane] |= (pulse_hi << pulse_bit_hi);
214 lane_bytes[lane] |= (pulse_lo << pulse_bit_lo);
215 }
216 }
217
218 for (int lane = 0; lane < 4; lane++) {
219 lane_waves[lane].data[symbol_idx] = lane_bytes[lane];
220 }
221 }
222
223 for (int lane = 0; lane < 4; lane++) {
224 fl::isr::memcopy(output + lane * sizeof(Wave3Byte), &lane_waves[lane], sizeof(Wave3Byte));
225 }
226}
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: