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

Function getRandom5

libraries/randomHelpers/randomHelpers.cpp:95–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94
95uint8_t getRandom5()
96{
97 if (__randomIdx < 5)
98 {
99 __randomBuffer = getRandom32();
100 __randomIdx = 32;
101 }
102 uint8_t rv = __randomBuffer & 0x1F;
103 __randomBuffer >>= 5;
104 __randomIdx -= 5;
105 return rv;
106}
107
108
109uint8_t getRandom6()

Callers 1

unittestFunction · 0.85

Calls 1

getRandom32Function · 0.85

Tested by 1

unittestFunction · 0.68