A couple build fixes for mp_float_t = double (MICROPY_FLOAT_IMPL_DOUBLE).
Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
This commit is contained in:
parent
94e51de166
commit
b0c2c3c756
@ -129,8 +129,8 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar
|
||||
}
|
||||
bool mono = args[ARG_mono].u_bool;
|
||||
|
||||
float startup_delay = (args[ARG_startup_delay].u_obj == MP_OBJ_NULL)
|
||||
? STARTUP_DELAY_DEFAULT
|
||||
mp_float_t startup_delay = (args[ARG_startup_delay].u_obj == MP_OBJ_NULL)
|
||||
? (mp_float_t)STARTUP_DELAY_DEFAULT
|
||||
: mp_obj_get_float(args[ARG_startup_delay].u_obj);
|
||||
if (startup_delay < 0.0 || startup_delay > 1.0) {
|
||||
mp_raise_ValueError(translate("Microphone startup delay must be in range 0.0 to 1.0"));
|
||||
|
@ -116,7 +116,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co
|
||||
}
|
||||
|
||||
mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj);
|
||||
if (timeout > 100.0f) {
|
||||
if (timeout > (mp_float_t)100.0) {
|
||||
mp_raise_ValueError(translate("timeout >100 (units are now seconds, not msecs)"));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user