File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/components/i2c/drivers Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,13 @@ class WipperSnapper_I2C_Driver_HDC302X : public WipperSnapper_I2C_Driver {
74
74
WS_DEBUG_PRINTLN (F (" Device Reset Detected" ));
75
75
return false ;
76
76
}
77
+
77
78
if (status & 0x0001 ) {
78
79
WS_DEBUG_PRINTLN (
79
80
F (" Checksum Verification Fail (incorrect checksum received)" ));
80
81
return false ;
81
82
}
83
+
82
84
if (!_hdc302x->readTemperatureHumidityOnDemand (_temp, _humidity,
83
85
TRIGGERMODE_LP0)) {
84
86
WS_DEBUG_PRINTLN (F (" Failed to read temperature and humidity." ));
@@ -99,7 +101,8 @@ class WipperSnapper_I2C_Driver_HDC302X : public WipperSnapper_I2C_Driver {
99
101
bool getEventAmbientTemp (sensors_event_t *tempEvent) {
100
102
if (readSensorData () == false )
101
103
return false ;
102
- return tempEvent->temperature = _temp;
104
+ tempEvent->temperature = _temp;
105
+ return true ;
103
106
}
104
107
105
108
/* ******************************************************************************/
@@ -114,7 +117,8 @@ class WipperSnapper_I2C_Driver_HDC302X : public WipperSnapper_I2C_Driver {
114
117
bool getEventRelativeHumidity (sensors_event_t *humidEvent) {
115
118
if (readSensorData () == false )
116
119
return false ;
117
- return humidEvent->relative_humidity = _humidity;
120
+ humidEvent->relative_humidity = _humidity;
121
+ return true ;
118
122
}
119
123
120
124
protected:
You can’t perform that action at this time.
0 commit comments