1 parent a4c8ef9 commit 6abafcaCopy full SHA for 6abafca
1 file changed
esp8266/modutime.c
@@ -102,7 +102,11 @@ MP_DEFINE_CONST_FUN_OBJ_1(time_mktime_obj, time_mktime);
102
/// \function sleep(seconds)
103
/// Sleep for the given number of seconds.
104
STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
105
+ #if MICROPY_PY_BUILTINS_FLOAT
106
+ mp_hal_delay_ms(1000 * mp_obj_get_float(seconds_o));
107
+ #else
108
mp_hal_delay_ms(1000 * mp_obj_get_int(seconds_o));
109
+ #endif
110
return mp_const_none;
111
}
112
MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_obj, time_sleep);
0 commit comments