Skip to content

Commit b79814c

Browse files
committed
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.
1 parent 0d54598 commit b79814c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

micropython/modules/breakout_scd41/breakout_scd41.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ mp_obj_t scd41_get_data_ready() {
6969
mp_raise_msg(&mp_type_RuntimeError, NOT_INITIALISED_MSG);
7070
return mp_const_none;
7171
}
72-
uint16_t data_ready = 0;
73-
int error = scd4x_get_data_ready_status(&data_ready);
72+
bool data_ready = false;
73+
int error = scd4x_get_data_ready_flag(&data_ready);
7474
if(error) {
7575
mp_raise_msg(&mp_type_RuntimeError, READ_FAIL_MSG);
7676
return mp_const_none;
7777
}
7878
// The datasheet doesn't really say *which* bit might be 1 if data is ready...
7979
// so check if the least significant eleven bits are != 0
80-
return (data_ready & 0x7ff) ? mp_const_true : mp_const_false;
80+
return data_ready ? mp_const_true : mp_const_false;
8181
}
8282

8383
mp_obj_t scd41_set_temperature_offset(mp_obj_t offset) {

0 commit comments

Comments
 (0)