Skip to content

Commit 1c50e12

Browse files
committed
D6T-1A: Move initialisation values to constructor
1 parent fe32ce6 commit 1c50e12

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_D6T1A.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
4141
: WipperSnapper_I2C_Driver(i2c, sensorAddress) {
4242
_i2c = i2c;
4343
_sensorAddress = sensorAddress;
44+
_deviceTemp = NAN;
45+
_objectTemp = NAN;
46+
_lastRead = 0;
4447
}
4548

4649
/*******************************************************************************/
@@ -130,9 +133,9 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
130133
}
131134

132135
protected:
133-
float _deviceTemp = NAN; ///< Device temperature in Celsius
134-
float _objectTemp = NAN; ///< Object temperature in Celsius
135-
uint32_t _lastRead = 0; ///< Last time the sensor was read in milliseconds
136+
float _deviceTemp; ///< Device temperature in Celsius
137+
float _objectTemp; ///< Object temperature in Celsius
138+
uint32_t _lastRead; ///< Last time the sensor was read in milliseconds
136139
OmronD6T *_d6t1a = nullptr; ///< D6T1A object
137140
};
138141

0 commit comments

Comments
 (0)