From e1ec5d349c9e7a3bcb044fe270b2b124ef566edc Mon Sep 17 00:00:00 2001 From: Amerlander Date: Wed, 13 Dec 2023 13:18:16 +0100 Subject: [PATCH] revert seedRandom --- model/MicroBit.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/model/MicroBit.cpp b/model/MicroBit.cpp index 6b26f0ee..79f63bb2 100644 --- a/model/MicroBit.cpp +++ b/model/MicroBit.cpp @@ -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,