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

Function bitRotateLeft

libraries/bitHelpers/bitHelpers.cpp:314–319  ·  view source on GitHub ↗

/////////////////////////////////////////// BIT ROTATE LEFT

Source from the content-addressed store, hash-verified

312// BIT ROTATE LEFT
313//
314uint8_t bitRotateLeft(uint8_t value, uint8_t pos)
315{
316 if (pos == 0) return value;
317 if (pos > 7) return value;
318 return (value << pos) | (value >> (8 - pos));
319}
320
321
322uint16_t bitRotateLeft(uint16_t value, uint8_t pos)

Callers 1

unittestFunction · 0.85

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.68