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

Function bitReverse

libraries/bitHelpers/bitHelpers.cpp:142–149  ·  view source on GitHub ↗

/////////////////////////////////////////// BIT REVERSE

Source from the content-addressed store, hash-verified

140// BIT REVERSE
141//
142uint8_t bitReverse(uint8_t value)
143{
144 uint8_t x = value;
145 x = (((x & 0xAA) >> 1) | ((x & 0x55) << 1));
146 x = (((x & 0xCC) >> 2) | ((x & 0x33) << 2));
147 x = (x >> 4) | (x << 4);
148 return x;
149}
150
151
152uint16_t bitReverse(uint16_t value)

Callers 1

unittestFunction · 0.85

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.68