MCPcopy Create free account
hub / github.com/FastLED/FastLED / transpose_reference

Function transpose_reference

tests/platforms/shared/clockless_timing.cpp:468–485  ·  view source on GitHub ↗

@brief Reference transpose - converts 16 bytes to 8 uint16_t words Input: 16 bytes, one per lane (lanes 0-15) Output: 8 words representing bits 0-7 across all 16 lanes Example: input[0] = 0b10101010 (lane 0) input[1] = 0b11001100 (lane 1) ... output[0] = bit 0 from all 16 lanes (16-bit word) output[1] = bit 1 from all 16 lanes ... output[7] = bit 7 from all 16 lanes

Source from the content-addressed store, hash-verified

466/// ...
467/// output[7] = bit 7 from all 16 lanes
468void transpose_reference(const uint8_t* input, uint16_t* output) {
469 // Clear output
470 for (int i = 0; i < 8; i++) {
471 output[i] = 0;
472 }
473
474 // For each bit position (0 to 7)
475 for (int bit = 0; bit < 8; bit++) {
476 // For each lane (0 to 15)
477 for (int lane = 0; lane < 16; lane++) {
478 // Extract bit from input[lane]
479 if ((input[lane] >> bit) & 1) {
480 // Set corresponding bit in output[bit]
481 output[bit] |= (1 << lane);
482 }
483 }
484 }
485}
486
487FL_TEST_CASE("LCD bit templates - generateTemplates validation") {
488 FL_SUBCASE("Bit-0 template structure") {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected