Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove RNG seed call in platform_init(). #5945

Merged
merged 1 commit into from
Sep 20, 2024
Merged

Remove RNG seed call in platform_init(). #5945

merged 1 commit into from
Sep 20, 2024

Conversation

microbit-carlos
Copy link
Collaborator

@microbit-carlos microbit-carlos commented Sep 13, 2024

This call is not needed, as the random number generator is already seeded in uBit.init().

This also resolves/works-around this issue (more info in #5409 (comment)), which might take a while before we fix it in DAL:

Apart from that, this is a costly call, specially in V1 where it takes 50 microsec or more, and in theory could take up to 480 us.

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.
@microbit-carlos
Copy link
Collaborator Author

Using the testing deployement :

Creating a new project, adding the Bluetooth extension and this code:

basic.showNumber(randint(0, 9))
basic.forever(function () {
	
})

And it shows that it does resolve:

@abchatra abchatra merged commit dbb29b6 into master Sep 20, 2024
7 checks passed
@abchatra abchatra deleted the rand-seed branch September 20, 2024 17:02
abchatra pushed a commit that referenced this pull request Sep 23, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants