File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565//|
6666STATIC mp_obj_t time_monotonic (void ) {
6767 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 ) );
6969}
7070MP_DEFINE_CONST_FUN_OBJ_0 (time_monotonic_obj , time_monotonic );
7171
@@ -78,7 +78,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_obj, time_monotonic);
7878STATIC mp_obj_t time_sleep (mp_obj_t seconds_o ) {
7979 #if MICROPY_PY_BUILTINS_FLOAT
8080 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 ) ;
8282 #else
8383 mp_int_t seconds = mp_obj_get_int (seconds_o );
8484 mp_int_t msecs = 1000 * seconds ;
You can’t perform that action at this time.
0 commit comments