From 26e041ab6efe14da3d918154e9d4d0d87f352198 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 14 Sep 2020 12:26:32 +0200 Subject: [PATCH] Fix reset BMP sensors Fix reset BMP sensors when executing command ``SaveData`` and define USE_DEEPSLEEP enabled (#9300) --- RELEASENOTES.md | 1 + tasmota/CHANGELOG.md | 1 + tasmota/xsns_09_bmp.ino | 20 +++++++++++--------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3e4973403..9b3740986 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -59,6 +59,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - Fix energy total counters (#9263, #9266) - Fix crash in ``ZbRestore`` +- Fix reset BMP sensors when executing command ``SaveData`` and define USE_DEEPSLEEP enabled (#9300) - Add new shutter modes (#9244) - Add ``#define USE_MQTT_AWS_IOT_LIGHT`` for password based AWS IoT authentication - Add Zigbee auto-config when pairing diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 66a086bd6..5c0d36fd2 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -6,6 +6,7 @@ - Fix energy total counters (#9263, #9266) - Fix crash in ``ZbRestore`` +- Fix reset BMP sensors when executing command ``SaveData`` and define USE_DEEPSLEEP enabled (#9300) - Add new shutter modes (#9244) - Add ``#define USE_MQTT_AWS_IOT_LIGHT`` for password based AWS IoT authentication - Add Zigbee auto-config when pairing diff --git a/tasmota/xsns_09_bmp.ino b/tasmota/xsns_09_bmp.ino index 9e3ee59b4..8e1bd074a 100644 --- a/tasmota/xsns_09_bmp.ino +++ b/tasmota/xsns_09_bmp.ino @@ -613,15 +613,17 @@ void BmpShow(bool json) void BMP_EnterSleep(void) { - for (uint32_t bmp_idx = 0; bmp_idx < bmp_count; bmp_idx++) { - switch (bmp_sensors[bmp_idx].bmp_type) { - case BMP180_CHIPID: - case BMP280_CHIPID: - case BME280_CHIPID: - I2cWrite8(bmp_sensors[bmp_idx].bmp_address, BMP_REGISTER_RESET, BMP_CMND_RESET); - break; - default: - break; + if (DeepSleepEnabled()) { + for (uint32_t bmp_idx = 0; bmp_idx < bmp_count; bmp_idx++) { + switch (bmp_sensors[bmp_idx].bmp_type) { + case BMP180_CHIPID: + case BMP280_CHIPID: + case BME280_CHIPID: + I2cWrite8(bmp_sensors[bmp_idx].bmp_address, BMP_REGISTER_RESET, BMP_CMND_RESET); + break; + default: + break; + } } } }