diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2023-06-01 02:56:26 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2023-06-01 02:56:26 +0300 |
commit | 2a761a7261b1ce4a93f7dd431e6604c21f232769 (patch) | |
tree | 35d7e764898825fe0851bd3f2b13acd58cc522ee /platformio/common/libs/temphum/homekit | |
parent | b02a9c5473267da88a9182a5b06753f62b689042 (diff) |
pio/temphum: fix
Diffstat (limited to 'platformio/common/libs/temphum/homekit')
-rw-r--r-- | platformio/common/libs/temphum/homekit/temphum.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platformio/common/libs/temphum/homekit/temphum.cpp b/platformio/common/libs/temphum/homekit/temphum.cpp index ac4d371..e69b3a5 100644 --- a/platformio/common/libs/temphum/homekit/temphum.cpp +++ b/platformio/common/libs/temphum/homekit/temphum.cpp @@ -30,6 +30,7 @@ SensorData Si7021::read() { Wire.requestFrom(dev_addr, 2); if (Wire.available() < 2) { PRINTLN("Si7021: 0xf3: could not read 2 bytes"); + error = 1; } uint16_t temp_raw = Wire.read() << 8 | Wire.read(); double temperature = ((175.72 * temp_raw) / 65536.0) - 46.85; @@ -38,6 +39,7 @@ SensorData Si7021::read() { Wire.requestFrom(dev_addr, 2); if (Wire.available() < 2) { PRINTLN("Si7021: 0xf5: could not read 2 bytes"); + error = 1; } uint16_t hum_raw = Wire.read() << 8 | Wire.read(); double humidity = ((125.0 * hum_raw) / 65536.0) - 6.0; @@ -84,4 +86,4 @@ end: return sd; } -}
\ No newline at end of file +} |