FastLED
3.9.15
Loading...
Searching...
No Matches
transpose8x1_noinline.cpp
Go to the documentation of this file.
1
3
4
#include <stdint.h>
5
6
#include "
transpose8x1_noinline.h
"
7
8
#pragma GCC diagnostic push
9
#pragma GCC diagnostic ignored "-Wcast-align"
10
11
void
transpose8x1_noinline
(
unsigned
char
*A,
unsigned
char
*B) {
12
uint32_t
x
,
y
, t;
13
14
// Load the array and pack it into x and y.
15
y
= *(
unsigned
int
*)(A);
16
x
= *(
unsigned
int
*)(A+4);
17
18
// pre-transform x
19
t = (
x
^ (
x
>> 7)) & 0x00AA00AA;
x
=
x
^ t ^ (t << 7);
20
t = (
x
^ (
x
>>14)) & 0x0000CCCC;
x
=
x
^ t ^ (t <<14);
21
22
// pre-transform y
23
t = (
y
^ (
y
>> 7)) & 0x00AA00AA;
y
=
y
^ t ^ (t << 7);
24
t = (
y
^ (
y
>>14)) & 0x0000CCCC;
y
=
y
^ t ^ (t <<14);
25
26
// final transform
27
t = (
x
& 0xF0F0F0F0) | ((
y
>> 4) & 0x0F0F0F0F);
28
y
= ((
x
<< 4) & 0xF0F0F0F0) | (
y
& 0x0F0F0F0F);
29
x
= t;
30
31
*((uint32_t*)B) =
y
;
32
*((uint32_t*)(B+4)) =
x
;
33
}
34
35
#pragma GCC diagnostic pop
x
uint32_t x[NUM_LAYERS]
Definition
Fire2023.ino:80
y
uint32_t y[NUM_LAYERS]
Definition
Fire2023.ino:81
transpose8x1_noinline
void transpose8x1_noinline(unsigned char *A, unsigned char *B)
Simplified form of bits rotating function.
Definition
transpose8x1_noinline.cpp:11
transpose8x1_noinline.h
Declares the 8x1 transposition function.
transpose8x1_noinline.cpp
Generated on Fri Apr 18 2025 03:39:31 for FastLED by
1.13.2