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 {
147147
148148protected:
149149 Adafruit_SGP40 *_sgp40; // /< SGP40
150- // background accumulation state
150+
151+ /* * Millis timestamp of last 1 Hz background read. */
151152 uint32_t _lastFastMs = 0 ;
153+
154+ /* * Number of samples accumulated since last publish. */
152155 uint32_t _n = 0 ;
156+
157+ /* * Running sum of VOC index samples for averaging. */
153158 float _vocSum = 0 .0f ;
159+
160+ /* * Running sum of raw samples for averaging. */
154161 uint32_t _rawSum = 0 ;
155162
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+ /* ******************************************************************************/
157169 inline bool vocEnabled () {
158170 return (getSensorVOCIndexPeriod () > 0 ) || (getSensorRawPeriod () > 0 );
159171 }
You can’t perform that action at this time.
0 commit comments