File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/components/i2c/drivers Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -94,12 +94,24 @@ class WipperSnapper_I2C_Driver_SGP30 : public WipperSnapper_I2C_Driver {
94
94
protected:
95
95
Adafruit_SGP30 *_sgp30; // /< Pointer to SGP30 sensor object
96
96
97
- // Fast sampling state
97
+ /* * Millis timestamp of last 1 Hz background read. */
98
98
uint32_t _lastFastMs = 0 ;
99
+
100
+ /* * Number of samples accumulated since last publish. */
99
101
uint32_t _n = 0 ;
102
+
103
+ /* * Running sum of eCO2 samples for averaging. */
100
104
uint32_t _eco2Sum = 0 ;
105
+
106
+ /* * Running sum of TVOC samples for averaging. */
101
107
uint32_t _tvocSum = 0 ;
102
108
109
+ /* ******************************************************************************/
110
+ /* !
111
+ @brief Returns whether IAQ background sampling should be active.
112
+ @return True if either eCO2 or TVOC metrics are configured to publish.
113
+ */
114
+ /* ******************************************************************************/
103
115
inline bool iaqEnabled () {
104
116
// Enable IAQ background reads if either metric is requested
105
117
return (getSensorECO2Period () > 0 ) || (getSensorTVOCPeriod () > 0 );
You can’t perform that action at this time.
0 commit comments