File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/components/i2c/drivers Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -147,13 +147,25 @@ class WipperSnapper_I2C_Driver_SGP40 : public WipperSnapper_I2C_Driver {
147
147
148
148
protected:
149
149
Adafruit_SGP40 *_sgp40; // /< SGP40
150
- // background accumulation state
150
+
151
+ /* * Millis timestamp of last 1 Hz background read. */
151
152
uint32_t _lastFastMs = 0 ;
153
+
154
+ /* * Number of samples accumulated since last publish. */
152
155
uint32_t _n = 0 ;
156
+
157
+ /* * Running sum of VOC index samples for averaging. */
153
158
float _vocSum = 0 .0f ;
159
+
160
+ /* * Running sum of raw samples for averaging. */
154
161
uint32_t _rawSum = 0 ;
155
162
156
- // enable fast sampling if either output is requested
163
+ /* ******************************************************************************/
164
+ /* !
165
+ @brief Returns whether VOC background sampling should be active.
166
+ @return True if either VOC Index or raw value is configured to publish.
167
+ */
168
+ /* ******************************************************************************/
157
169
inline bool vocEnabled () {
158
170
return (getSensorVOCIndexPeriod () > 0 ) || (getSensorRawPeriod () > 0 );
159
171
}
You can’t perform that action at this time.
0 commit comments