parent
0cdd8f5539
commit
9b76570be8
@ -0,0 +1,10 @@
|
||||
#include <Entropy.h>
|
||||
|
||||
inline void random_begin() {
|
||||
// Initialise the system to start gathering entropy ready to generate random numbers later
|
||||
Entropy.initialize();
|
||||
}
|
||||
|
||||
inline uint32_t random_get() {
|
||||
return Entropy.random();
|
||||
}
|
@ -1 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Initialises the random number generation system.
|
||||
* It's important to do this as early as possible, as it takes a while to
|
||||
* gather the necessary entropy in order to actually generate a random number.
|
||||
*/
|
||||
void random_begin();
|
||||
|
||||
// FUTURE: Swap this out for LoRa untuned wideband radio static?
|
||||
|
||||
/**
|
||||
* Gets an unsigned 32-bit random number.
|
||||
* @return {uint32_t} A random number.
|
||||
*/
|
||||
uint32_t random_get();
|
||||
|
Loading…
Reference in new issue