Commit 5161239c authored by Daniel Campora's avatar Daniel Campora
Browse files

cc3200: time.sleep() now receives seconds, like CPython.

parent 9a65fa30
......@@ -122,10 +122,10 @@ STATIC mp_obj_t time_mktime(mp_obj_t tuple) {
MP_DEFINE_CONST_FUN_OBJ_1(time_mktime_obj, time_mktime);
/// \function sleep(milliseconds)
/// Sleep for the given number of milliseconds.
STATIC mp_obj_t time_sleep(mp_obj_t milliseconds_o) {
HAL_Delay(mp_obj_get_int(milliseconds_o));
/// \function sleep(seconds)
/// Sleep for the given number of seconds.
STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
HAL_Delay(mp_obj_get_int(seconds_o) * 1000);
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_obj, time_sleep);
......
......@@ -38,18 +38,12 @@ Functions
Sleep for the given number of seconds. Seconds can be a floating-point number to
sleep for a fractional number of seconds.
.. only:: port_esp8266
.. only:: port_esp8266 or port_wipy
.. function:: sleep(seconds)
Sleep for the given number of seconds.
.. only:: port_wipy
.. function:: sleep(milliseconds)
Sleep for the given number of milliseconds.
.. function:: time()
Returns the number of seconds, as an integer, since 1/1/2000.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment