From dc931efaf85d5878f8418b38689af6817b650271 Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Fri, 20 Sep 2024 18:02:52 +0100 Subject: [PATCH] Remove rng seed call in platform_init(). (#5945) It is not needed, as the random number generator is already seeded in uBit.init(). This also works around this issue until it is resolved in DAL & CODAL: https://github.com/microsoft/pxt-microbit/issues/5409 Apart from that it is a costly call, specially in V1 where it takes 50 microsec or more, and in theory can take up to 480 us. --- libs/core/codal.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/core/codal.cpp b/libs/core/codal.cpp index 40fb3925363..b1d3dc2b9df 100644 --- a/libs/core/codal.cpp +++ b/libs/core/codal.cpp @@ -50,7 +50,6 @@ MicroBitEvent lastEvent; bool serialLoggingDisabled; void platform_init() { - microbit_seed_random(); int seed = microbit_random(0x7fffffff); DMESG("random seed: %d", seed); seedRandom(seed);