Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
36f97f19
Commit
36f97f19
authored
Oct 14, 2016
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extmod/utime_mphal: sleep_us/ms(): Don't wait on negative argument.
parent
f0595635
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
extmod/utime_mphal.c
extmod/utime_mphal.c
+8
-2
No files found.
extmod/utime_mphal.c
View file @
36f97f19
...
...
@@ -46,13 +46,19 @@ STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
MP_DEFINE_CONST_FUN_OBJ_1
(
mp_utime_sleep_obj
,
time_sleep
);
STATIC
mp_obj_t
time_sleep_ms
(
mp_obj_t
arg
)
{
mp_hal_delay_ms
(
mp_obj_get_int
(
arg
));
mp_int_t
ms
=
mp_obj_get_int
(
arg
);
if
(
ms
>
0
)
{
mp_hal_delay_ms
(
ms
);
}
return
mp_const_none
;
}
MP_DEFINE_CONST_FUN_OBJ_1
(
mp_utime_sleep_ms_obj
,
time_sleep_ms
);
STATIC
mp_obj_t
time_sleep_us
(
mp_obj_t
arg
)
{
mp_hal_delay_us
(
mp_obj_get_int
(
arg
));
mp_int_t
us
=
mp_obj_get_int
(
arg
);
if
(
us
>
0
)
{
mp_hal_delay_us
(
us
);
}
return
mp_const_none
;
}
MP_DEFINE_CONST_FUN_OBJ_1
(
mp_utime_sleep_us_obj
,
time_sleep_us
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment