Fix reset BMP sensors

Fix reset BMP sensors when executing command ``SaveData`` and define USE_DEEPSLEEP enabled (#9300)
This commit is contained in:
Theo Arends 2020-09-14 12:26:32 +02:00
parent 9aa18c23f0
commit 26e041ab6e
3 changed files with 13 additions and 9 deletions

View File

@ -59,6 +59,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
- Fix energy total counters (#9263, #9266) - Fix energy total counters (#9263, #9266)
- Fix crash in ``ZbRestore`` - Fix crash in ``ZbRestore``
- Fix reset BMP sensors when executing command ``SaveData`` and define USE_DEEPSLEEP enabled (#9300)
- Add new shutter modes (#9244) - Add new shutter modes (#9244)
- Add ``#define USE_MQTT_AWS_IOT_LIGHT`` for password based AWS IoT authentication - Add ``#define USE_MQTT_AWS_IOT_LIGHT`` for password based AWS IoT authentication
- Add Zigbee auto-config when pairing - Add Zigbee auto-config when pairing

View File

@ -6,6 +6,7 @@
- Fix energy total counters (#9263, #9266) - Fix energy total counters (#9263, #9266)
- Fix crash in ``ZbRestore`` - Fix crash in ``ZbRestore``
- Fix reset BMP sensors when executing command ``SaveData`` and define USE_DEEPSLEEP enabled (#9300)
- Add new shutter modes (#9244) - Add new shutter modes (#9244)
- Add ``#define USE_MQTT_AWS_IOT_LIGHT`` for password based AWS IoT authentication - Add ``#define USE_MQTT_AWS_IOT_LIGHT`` for password based AWS IoT authentication
- Add Zigbee auto-config when pairing - Add Zigbee auto-config when pairing

View File

@ -613,15 +613,17 @@ void BmpShow(bool json)
void BMP_EnterSleep(void) void BMP_EnterSleep(void)
{ {
for (uint32_t bmp_idx = 0; bmp_idx < bmp_count; bmp_idx++) { if (DeepSleepEnabled()) {
switch (bmp_sensors[bmp_idx].bmp_type) { for (uint32_t bmp_idx = 0; bmp_idx < bmp_count; bmp_idx++) {
case BMP180_CHIPID: switch (bmp_sensors[bmp_idx].bmp_type) {
case BMP280_CHIPID: case BMP180_CHIPID:
case BME280_CHIPID: case BMP280_CHIPID:
I2cWrite8(bmp_sensors[bmp_idx].bmp_address, BMP_REGISTER_RESET, BMP_CMND_RESET); case BME280_CHIPID:
break; I2cWrite8(bmp_sensors[bmp_idx].bmp_address, BMP_REGISTER_RESET, BMP_CMND_RESET);
default: break;
break; default:
break;
}
} }
} }
} }