mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
Register the noise sources with RNG at setup time
This commit is contained in:
@@ -29,6 +29,9 @@ void setup() {
|
||||
// Initialize the random number generator.
|
||||
RNG.begin(RNG_APP_TAG, RNG_EEPROM_ADDRESS);
|
||||
|
||||
// Add the noise source to the list of sources known to RNG.
|
||||
RNG.addNoiseSource(noise);
|
||||
|
||||
startTime = millis();
|
||||
}
|
||||
|
||||
@@ -58,9 +61,6 @@ void loop() {
|
||||
Serial.println("calibrating");
|
||||
}
|
||||
|
||||
// If the noise source has accumulated new entropy, then stir it in.
|
||||
RNG.stir(noise);
|
||||
|
||||
// Perform regular housekeeping on the random number generator.
|
||||
RNG.loop();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user