Skip to content

Commit

Permalink
Remove rng seed call in platform_init().
Browse files Browse the repository at this point in the history
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:
#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.
  • Loading branch information
microbit-carlos committed Sep 13, 2024
1 parent 7cc19bb commit ab095e3
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion libs/core/codal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ab095e3

Please sign in to comment.