Skip to content

Commit

Permalink
revert seedRandom
Browse files Browse the repository at this point in the history
  • Loading branch information
Amerlander committed Dec 13, 2023
1 parent 1caa374 commit e1ec5d3
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions model/MicroBit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,22 +202,7 @@ int MicroBit::init()
}

// Seed our random number generator
if(ble_running())
{
// Readings from different sensors
int16_t accelerometerX = accelerometer.getX();
int16_t accelerometerY = accelerometer.getY();
int16_t accelerometerZ = accelerometer.getZ();
int16_t temperatureValue = thermometer.getTemperature();
int16_t microphoneValue = audio.getVolume();
// Combine sensor values using XOR
uint32_t r = accelerometerX ^ accelerometerY ^ accelerometerZ ^ temperatureValue ^ microphoneValue;
seedRandom(r);
}
else
{
seedRandom();
}
seedRandom();

// Create an event handler to trap any handlers being created for I2C services.
// We do this to enable initialisation of those services only when they're used,
Expand Down

0 comments on commit e1ec5d3

Please sign in to comment.