File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 65
65
//|
66
66
STATIC mp_obj_t time_monotonic (void ) {
67
67
uint64_t ticks_ms = common_hal_time_monotonic_ms ();
68
- return mp_obj_new_float (uint64_to_float (ticks_ms ) / 1000.0f );
68
+ return mp_obj_new_float (uint64_to_float (ticks_ms ) / MICROPY_FLOAT_CONST ( 1000.0 ) );
69
69
}
70
70
MP_DEFINE_CONST_FUN_OBJ_0 (time_monotonic_obj , time_monotonic );
71
71
@@ -78,7 +78,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_obj, time_monotonic);
78
78
STATIC mp_obj_t time_sleep (mp_obj_t seconds_o ) {
79
79
#if MICROPY_PY_BUILTINS_FLOAT
80
80
mp_float_t seconds = mp_obj_get_float (seconds_o );
81
- mp_float_t msecs = 1000.0f * seconds + 0.5f ;
81
+ mp_float_t msecs = MICROPY_FLOAT_CONST ( 1000.0 ) * seconds + MICROPY_FLOAT_CONST ( 0.5 ) ;
82
82
#else
83
83
mp_int_t seconds = mp_obj_get_int (seconds_o );
84
84
mp_int_t msecs = 1000 * seconds ;
You can’t perform that action at this time.
0 commit comments