File tree 2 files changed +5
-11
lines changed 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,10 @@ STATIC mp_obj_t time_mktime(mp_obj_t tuple) {
122
122
MP_DEFINE_CONST_FUN_OBJ_1 (time_mktime_obj , time_mktime );
123
123
124
124
125
- /// \function sleep(milliseconds )
126
- /// Sleep for the given number of milliseconds .
127
- STATIC mp_obj_t time_sleep (mp_obj_t milliseconds_o ) {
128
- HAL_Delay (mp_obj_get_int (milliseconds_o ) );
125
+ /// \function sleep(seconds )
126
+ /// Sleep for the given number of seconds .
127
+ STATIC mp_obj_t time_sleep (mp_obj_t seconds_o ) {
128
+ HAL_Delay (mp_obj_get_int (seconds_o ) * 1000 );
129
129
return mp_const_none ;
130
130
}
131
131
MP_DEFINE_CONST_FUN_OBJ_1 (time_sleep_obj , time_sleep );
Original file line number Diff line number Diff line change @@ -38,18 +38,12 @@ Functions
38
38
Sleep for the given number of seconds. Seconds can be a floating-point number to
39
39
sleep for a fractional number of seconds.
40
40
41
- .. only :: port_esp8266
41
+ .. only :: port_esp8266 or port_wipy
42
42
43
43
.. function :: sleep(seconds)
44
44
45
45
Sleep for the given number of seconds.
46
46
47
- .. only :: port_wipy
48
-
49
- .. function :: sleep(milliseconds)
50
-
51
- Sleep for the given number of milliseconds.
52
-
53
47
.. function :: time()
54
48
55
49
Returns the number of seconds, as an integer, since 1/1/2000.
You can’t perform that action at this time.
0 commit comments