MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / reverse8

Function reverse8

libraries/CRC/CRC.cpp:16–23  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////// fast reverse from bitHelper library

Source from the content-addressed store, hash-verified

14// fast reverse from bitHelper library
15//
16uint8_t reverse8(uint8_t in)
17{
18 uint8_t x = in;
19 x = (((x & 0xAA) >> 1) | ((x & 0x55) << 1));
20 x = (((x & 0xCC) >> 2) | ((x & 0x33) << 2));
21 x = ((x >> 4) | (x << 4));
22 return x;
23}
24
25
26uint16_t reverse16(uint16_t in)

Callers 6

crc8Function · 0.85
crc12Function · 0.85
crc16Function · 0.85
crc32Function · 0.85
crc64Function · 0.85
fooFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected