SCD4X: scd4x_get_data_ready_status to scd4x_get_data_ready_flag.

The function name and behaviour has changed, moving the bitwise check
into the API and making it an implementation detail.
pull/1029/head
Phil Howard 2024-11-18 10:42:56 +00:00
rodzic 0d545981dc
commit b79814cae3
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -69,15 +69,15 @@ mp_obj_t scd41_get_data_ready() {
mp_raise_msg(&mp_type_RuntimeError, NOT_INITIALISED_MSG);
return mp_const_none;
}
uint16_t data_ready = 0;
int error = scd4x_get_data_ready_status(&data_ready);
bool data_ready = false;
int error = scd4x_get_data_ready_flag(&data_ready);
if(error) {
mp_raise_msg(&mp_type_RuntimeError, READ_FAIL_MSG);
return mp_const_none;
}
// The datasheet doesn't really say *which* bit might be 1 if data is ready...
// so check if the least significant eleven bits are != 0
return (data_ready & 0x7ff) ? mp_const_true : mp_const_false;
return data_ready ? mp_const_true : mp_const_false;
}
mp_obj_t scd41_set_temperature_offset(mp_obj_t offset) {