The previous test may never come true if we do not set the flag
authorNathael Pajani <nathael.pajani@ed3l.fr>
Thu, 18 Sep 2014 19:53:11 +0000 (21:53 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 8 Nov 2022 16:03:04 +0000 (17:03 +0100)
drivers/tmp101_temp_sensor.c

index fef9bc5..e358c75 100644 (file)
@@ -123,6 +123,7 @@ int tmp101_sensor_read(uint16_t* raw, int* deci_degrees)
        } else {
                /* Send (write) temperature register address to TMP101 internal pointer */
                ret = i2c_read(cmd_buf, CMD_BUF_SIZE, ctrl_buf, (char*)&temp, 2);
+               last_accessed_register = TMP_REG_TEMPERATURE;
        }
 
        if (ret == 2) {