BigW Consortium Gitlab

Commit 416e763f by David Clark

Updated interleaved reading

parent 7d905f13
--- ./BME680_driver/bme680.c 2018-05-15 10:35:44.730819635 -0700
+++ ./bme680.c 2018-05-15 09:55:23.278858200 -0700
@@ -991,7 +991,12 @@
diff --git a/bme680.c b/bme680.c
index 5b6bfd7..aefa886 100644
--- a/bme680.c
+++ b/bme680.c
@@ -358,13 +358,20 @@ int8_t bme680_set_regs(const uint8_t *reg_addr, const uint8_t *reg_data, uint8_t
tmp_buff[(2 * index)] = reg_addr[index];
}
tmp_buff[(2 * index) + 1] = reg_data[index];
+#ifdef SIERRA
+ dev->com_rslt = dev->write(dev->dev_id, tmp_buff[2 * index], &tmp_buff[(2 * index) + 1], 1);
+ if (dev->com_rslt != 0)
+ rslt = BME680_E_COM_FAIL;
+#endif
}
+#ifndef SIERRA
/* Write the interleaved array */
if (rslt == BME680_OK) {
dev->com_rslt = dev->write(dev->dev_id, tmp_buff[0], &tmp_buff[1], (2 * len) - 1);
if (dev->com_rslt != 0)
rslt = BME680_E_COM_FAIL;
}
+#endif
} else {
rslt = BME680_E_INVALID_LENGTH;
}
@@ -770,6 +777,7 @@ static int8_t get_calib_data(struct bme680_dev *dev)
| (coeff_array[BME680_H1_LSB_REG] & BME680_BIT_H1_DATA_MSK));
dev->calib.par_h2 = (uint16_t) (((uint16_t) coeff_array[BME680_H2_MSB_REG] << BME680_HUM_REG_SHIFT_VAL)
| ((coeff_array[BME680_H2_LSB_REG]) >> BME680_HUM_REG_SHIFT_VAL));
+
dev->calib.par_h3 = (int8_t) coeff_array[BME680_H3_REG];
dev->calib.par_h4 = (int8_t) coeff_array[BME680_H4_REG];
dev->calib.par_h5 = (int8_t) coeff_array[BME680_H5_REG];
@@ -991,7 +999,12 @@ static uint32_t calc_gas_resistance(uint16_t gas_res_adc, uint8_t gas_range, con
((int64_t) lookupTable1[gas_range])) >> 16;
var2 = (((int64_t) ((int64_t) gas_res_adc << 15) - (int64_t) (16777216)) + var1);
var3 = (((int64_t) lookupTable2[gas_range] * (int64_t) var1) >> 9);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment