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

Function bitRotateRight

libraries/bitHelpers/bitHelpers.cpp:350–355  ·  view source on GitHub ↗

/////////////////////////////////////////// BIT ROTATE RIGHT

Source from the content-addressed store, hash-verified

348// BIT ROTATE RIGHT
349//
350uint8_t bitRotateRight(uint8_t value, uint8_t pos)
351{
352 if (pos == 0) return value;
353 if (pos > 7) return value;
354 return (value << (8 - pos)) | (value >> pos);
355}
356
357
358uint16_t bitRotateRight(uint16_t value, uint8_t pos)

Callers 1

unittestFunction · 0.85

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.68