kopia lustrzana https://github.com/pimoroni/pimoroni-pico
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
rodzic
0d545981dc
commit
b79814cae3
|
@ -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) {
|
||||
|
|
Ładowanie…
Reference in New Issue