1
0
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:
Rhys Weatherley
2015-03-25 19:35:44 +10:00
parent fd38b7e127
commit 067e8ac177
6 changed files with 52 additions and 23 deletions

View File

@@ -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();