-
Notifications
You must be signed in to change notification settings - Fork 686
Move the sleep function to jerry-port #2245
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
Conversation
009332f to
e78e6c9
Compare
jerry-port/default/default-date.c
Outdated
|
|
||
| #ifdef JERRY_DEBUGGER | ||
| #include <jrt.h> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've added this include twice. Remove from here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is jrt.h required in default-date.c at all? that seems like a layering violation to me. if that's only for the sake of uint32_t, there are standard libc headers that could be included.
jerry-port/default/default-date.c
Outdated
|
|
||
| #ifdef JERRY_DEBUGGER | ||
| #include <jrt.h> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is jrt.h required in default-date.c at all? that seems like a layering violation to me. if that's only for the sake of uint32_t, there are standard libc headers that could be included.
| */ | ||
| #ifdef JERRY_DEBUGGER | ||
| void jerry_port_sleep (uint32_t sleep_time); | ||
| #endif /* JERRY_DEBUGGER */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is outside the comment group. should be within.
|
@robertsipka @akosthekiss Thank you for the reviews. I updated the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/05.PORT-API.md must be updated as well. I think the new port functions shouldn't be in the default-date.c. It belongs only to the debugger, so It would be better to put it into a new file called jerry-port/default/default-debugger.c
Now the jerry-debugger uses the jerry-port's sleep, therefore if there are systems that don't support usleep or nanosleep can now define their own function. JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
|
@LaszloLango Thank you for the review. Moved the port function to a new file and updated the |
LaszloLango
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
LGTM |
| struct jerry_instance_t *jerry_port_get_current_instance (void); | ||
|
|
||
| /** | ||
| * Makes the process sleep for a given time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the unit of time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unit of time is millisecond.
Now the jerry-debugger uses the jerry-port's sleep, therefore if there are systems that don't support
usleep or nanosleep they can now define their own function.
JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu