BME680 driver bug

In the file bme680.c on lines 1212 to 1215, we can read:

rslt = null_ptr_check(dev);
do {
    if (rslt == BME680_OK) {
        rslt = bme680_get_regs(((uint8_t) (BME680_FIELD0_ADDR)), buff, (uint16_t) BME680_FIELD_LENGTH,

The issue is that the variable "rslt" is not altered further down the loop, so when there is an error the first time, "rslt" will be different than BME680_OK, so the "if" on line 1214 will always be false, and the bme680_get_regs function will never be called again.

So at the end, this code will always try a maximum of 1 time.

Thank you.

JL, Clarity IoT


                                       

Best reply by Minhwan
View original
5 replies
Resolved