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

Function bitCountReference

libraries/bitHelpers/bitHelpers.cpp:19–29  ·  view source on GitHub ↗

/////////////////////////////////////////// BIT COUNT TEST

Source from the content-addressed store, hash-verified

17// BIT COUNT TEST
18//
19uint8_t bitCountReference(uint32_t value)
20{
21 uint32_t v = value;
22 uint8_t count = 0;
23 while (v > 0)
24 {
25 if (v & 1) count++;
26 v >>= 1;
27 }
28 return count;
29}
30
31
32uint8_t bitCountKR(uint32_t value)

Callers 1

unittestFunction · 0.85

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.68