Skip to content

Fix random number generation on ESP8266 #2157

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

Merged
merged 1 commit into from
Jan 4, 2018

Conversation

rerobika
Copy link
Member

@rerobika rerobika commented Jan 2, 2018

This patch uses the onboard RTC for generating random seed. It also improves the print handler to support float values.
The rom segment is slightly increased to fit to the latest master.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]

Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

double number = jerry_get_number_value (args_p[cc]);
if ((int) number == number)
{
printf ("%d", number);
Copy link
Contributor

@robertsipka robertsipka Jan 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not this cause a warning here? Is it print a correct number at all? Not just rubbish?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it, and it caused an issue. Thanks for your suggestion, I'm going to fix it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, now it works as intended.

This patch uses the onboard RTC for generating random seed. It also improves the print handler to support float values.
The rom segment is slightly increased to fit to the latest master.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
@robertsipka
Copy link
Contributor

LGTM (informally)

@yichoi
Copy link
Contributor

yichoi commented Jan 4, 2018

LGTM

@yichoi yichoi merged commit 543f75a into jerryscript-project:master Jan 4, 2018
@rerobika rerobika deleted the esp_random branch April 16, 2018 10:53
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.

4 participants