summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-09-24 17:15:07 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-09-24 17:15:07 +0200
commitef161249e308e933e10a0d9e07586f5ace146017 (patch)
tree53c5511f652d23c78ab3b101b9bbb788214c1c9c
parent01fd94f7bd70fd93b5dbb3a0dd7b30abfe28f95c (diff)
bme680: Fix setMemPage
-rw-r--r--src/driver/bme680.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/driver/bme680.cc b/src/driver/bme680.cc
index 52f94bf..2a27b18 100644
--- a/src/driver/bme680.cc
+++ b/src/driver/bme680.cc
@@ -1036,18 +1036,18 @@ int8_t BME680::setMemPage(uint8_t reg_addr)
{
int8_t rslt;
uint8_t reg;
- uint8_t mem_page;
+ uint8_t new_mem_page;
/* Check for null pointers in the device structure*/
rslt = nullPtrCheck();
if (rslt == BME680_OK) {
if (reg_addr > 0x7f)
- mem_page = BME680_MEM_PAGE1;
+ new_mem_page = BME680_MEM_PAGE1;
else
- mem_page = BME680_MEM_PAGE0;
+ new_mem_page = BME680_MEM_PAGE0;
- if (mem_page != mem_page) {
- mem_page = mem_page;
+ if (new_mem_page != mem_page) {
+ mem_page = new_mem_page;
com_rslt = read(dev_id, BME680_MEM_PAGE_ADDR | BME680_SPI_RD_MSK, &reg, 1);
if (com_rslt != 0)
@@ -1136,4 +1136,4 @@ int8_t BME680::nullPtrCheck()
return rslt;
}
-BME680 bme680(BME680_I2C_ADDR_SECONDARY); \ No newline at end of file
+BME680 bme680(BME680_I2C_ADDR_SECONDARY);