Skip to content

Commit

Permalink
Remove rng seed call in platform_init(). (#5945)
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 authored and abchatra committed Sep 23, 2024
1 parent ed2a61c commit dc931ef
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 dc931ef

Please sign in to comment.