Fix unsafe floating point comparison

This commit is contained in:
Kamil Tomaszewski 2019-10-14 09:05:55 +02:00
parent b750ed3a0f
commit 150f9041e3
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ STATIC mp_obj_t analogio_analogin_obj_get_reference_voltage(mp_obj_t self_in) {
check_for_deinit(self);
float reference_voltage = common_hal_analogio_analogin_get_reference_voltage(self);
if (reference_voltage == 0.0f) {
if (reference_voltage <= 0.0f) {
return mp_const_none;
} else {
return mp_obj_new_float(reference_voltage);