Skip to content

Commit 172646a

Browse files
committed
Correct D6T model name and privates usage
1 parent cfdbfd6 commit 172646a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_D6T1A.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
5757
*/
5858
/*******************************************************************************/
5959
bool begin() {
60-
_d6t1a = new OmronD6T(OmronD6T.Model.D6T_1A, _i2c);
60+
_d6t1a = new OmronD6T(OmronD6T::Model.D6T_1A, _i2c);
6161
// attempt to initialize D6T1A
6262
if (!_d6t1a->begin(_sensorAddress)) return false;
6363
return true;
@@ -86,8 +86,8 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
8686
}
8787

8888
_d6t1a->read();
89-
_deviceTemp.temperature = _d6t1a->ambientTempC();
90-
_objectTemp.relative_humidity = _d6t1a->objectTempC();
89+
_deviceTemp = _d6t1a->ambientTempC();
90+
_objectTemp = _d6t1a->objectTempC();
9191
_lastRead = millis();
9292
return true;
9393
}
@@ -102,7 +102,7 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
102102
*/
103103
/*******************************************************************************/
104104
bool getEventAmbientTemp(sensors_event_t *tempEvent) {
105-
if (ReadSensorData() && _deviceTemp != nan) {
105+
if (ReadSensorData() && _deviceTemp != NAN) {
106106
// if the sensor was read recently, return the cached temperature
107107
tempEvent->temperature = _deviceTemp;
108108
return true;
@@ -120,7 +120,7 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
120120
*/
121121
/*******************************************************************************/
122122
bool getEventObjectTemp(sensors_event_t *tempEvent) {
123-
if (ReadSensorData() && _objectTemp != nan) {
123+
if (ReadSensorData() && _objectTemp != NAN) {
124124
// if the sensor was read recently, return the cached temperature
125125
tempEvent->temperature = _objectTemp;
126126
return true;
@@ -129,8 +129,8 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
129129
}
130130

131131
protected:
132-
float _deviceTemp = nan; ///< Device temperature in Celsius
133-
float _objectTemp = nan; ///< Object temperature in Celsius
132+
float _deviceTemp = NAN; ///< Device temperature in Celsius
133+
float _objectTemp = NAN; ///< Object temperature in Celsius
134134
uint32_t _lastRead = 0; ///< Last time the sensor was read in milliseconds
135135
OmronD6T *_d6t1a = nullptr; ///< D6T1A object
136136
};

0 commit comments

Comments
 (0)