Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
6abafca1
Commit
6abafca1
authored
Feb 03, 2016
by
Paul Sokolovsky
Browse files
esp8266/modutime: Support float argument to time.sleep().
parent
a4c8ef9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
esp8266/modutime.c
View file @
6abafca1
...
...
@@ -102,7 +102,11 @@ MP_DEFINE_CONST_FUN_OBJ_1(time_mktime_obj, time_mktime);
/// \function sleep(seconds)
/// Sleep for the given number of seconds.
STATIC
mp_obj_t
time_sleep
(
mp_obj_t
seconds_o
)
{
#if MICROPY_PY_BUILTINS_FLOAT
mp_hal_delay_ms
(
1000
*
mp_obj_get_float
(
seconds_o
));
#else
mp_hal_delay_ms
(
1000
*
mp_obj_get_int
(
seconds_o
));
#endif
return
mp_const_none
;
}
MP_DEFINE_CONST_FUN_OBJ_1
(
time_sleep_obj
,
time_sleep
);
...
...
Write
Preview
Supports
Markdown
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