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

◆ slowswap()

FASTLED_FORCE_INLINE void slowswap ( unsigned char * A,
unsigned char * B )

Slow version of the 8 byte by 8 bit rotation.

Definition at line 163 of file bitswap.h.

163 {
164
165 for(int row = 0; row < 7; ++row) {
166 fl::u8 x = A[row];
167
168 fl::u8 bit = (1<<row);
169 unsigned char *p = B;
170 for(fl::u32 mask = 1<<7 ; mask ; mask >>= 1) {
171 if(x & mask) {
172 *p++ |= bit;
173 } else {
174 *p++ &= ~bit;
175 }
176 }
177 // B[7] |= (x & 0x01) << row; x >>= 1;
178 // B[6] |= (x & 0x01) << row; x >>= 1;
179 // B[5] |= (x & 0x01) << row; x >>= 1;
180 // B[4] |= (x & 0x01) << row; x >>= 1;
181 // B[3] |= (x & 0x01) << row; x >>= 1;
182 // B[2] |= (x & 0x01) << row; x >>= 1;
183 // B[1] |= (x & 0x01) << row; x >>= 1;
184 // B[0] |= (x & 0x01) << row; x >>= 1;
185 }
186}
int x
Definition simple.h:92
unsigned char u8
Definition int.h:17

References FASTLED_FORCE_INLINE, and x.