Skip to content

Commit 2a0564b

Browse files
committed
return true in a readable way for HDC302x
1 parent e120688 commit 2a0564b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_HDC302X.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ class WipperSnapper_I2C_Driver_HDC302X : public WipperSnapper_I2C_Driver {
7474
WS_DEBUG_PRINTLN(F("Device Reset Detected"));
7575
return false;
7676
}
77+
7778
if (status & 0x0001) {
7879
WS_DEBUG_PRINTLN(
7980
F("Checksum Verification Fail (incorrect checksum received)"));
8081
return false;
8182
}
83+
8284
if (!_hdc302x->readTemperatureHumidityOnDemand(_temp, _humidity,
8385
TRIGGERMODE_LP0)) {
8486
WS_DEBUG_PRINTLN(F("Failed to read temperature and humidity."));
@@ -99,7 +101,8 @@ class WipperSnapper_I2C_Driver_HDC302X : public WipperSnapper_I2C_Driver {
99101
bool getEventAmbientTemp(sensors_event_t *tempEvent) {
100102
if (readSensorData() == false)
101103
return false;
102-
return tempEvent->temperature = _temp;
104+
tempEvent->temperature = _temp;
105+
return true;
103106
}
104107

105108
/*******************************************************************************/
@@ -114,7 +117,8 @@ class WipperSnapper_I2C_Driver_HDC302X : public WipperSnapper_I2C_Driver {
114117
bool getEventRelativeHumidity(sensors_event_t *humidEvent) {
115118
if (readSensorData() == false)
116119
return false;
117-
return humidEvent->relative_humidity = _humidity;
120+
humidEvent->relative_humidity = _humidity;
121+
return true;
118122
}
119123

120124
protected:

0 commit comments

Comments
 (0)