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

Function reverse16

libraries/CRC/CRC.cpp:26–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26uint16_t reverse16(uint16_t in)
27{
28 uint16_t x = in;
29 x = (((x & 0XAAAA) >> 1) | ((x & 0X5555) << 1));
30 x = (((x & 0xCCCC) >> 2) | ((x & 0X3333) << 2));
31 x = (((x & 0xF0F0) >> 4) | ((x & 0X0F0F) << 4));
32 x = (( x >> 8) | (x << 8));
33 return x;
34}
35
36
37uint16_t reverse12(uint16_t in)

Callers 2

reverse12Function · 0.85
crc16Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected