mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-18 17:31:42 +10:00
I2C reclock guard - avoid gazillion calls to reclock on SENXX sensors (#11412)
* Add SEN6X * Adds new SENXX class for SEN5X and SEN6X * Adds CO2 sensor calibration class to be shared among othre CO2 sensors * Make existing CO2 sensor draw from CO2Sensor class * Minor coment for CO2 sensor class * Move away from getRTC in SENXX class to keep track of time changes. * Change all sensors to millis for tracking time, instead of using getRTC * Add comments regarding VOC state * Avoid storing non-valid RTC Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Avoid CO2 sensor warm-up time to be below PM measured started Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Fix limits in CO2 sensor calibration Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Add pragma once on headers * Avoid non-working ASC commands Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Fix data poll * Move pm measure started before warmup check * Make cleaning non-blocking * Restore previous state if cleaning fails. Fix data ready condition. * Fix CO2 sensor checks for calibration * Add ReClockI2C guard to simplify calls to Reclock. Make SENXX calls to reclock outside of readBuffer, to avoid bizillion calls * Add new reClockGuard to all sensor classes that require it * Make clock guard store values on each construction and restore them directly * Reduce log messages * Update ADS1X15 to new guard --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
coderabbitai[bot]
parent
bca7c0b480
commit
c773049b1d
@@ -255,6 +255,11 @@ class SENXXSensor : public TelemetrySensor, public CO2CalibrationSensor
|
||||
bool readPNValues(bool cumulative);
|
||||
bool readValues();
|
||||
|
||||
// Actual wakeUp() logic, factored out so handleAdminMessage() can resume
|
||||
// measurement after a calibration pause without nesting a second I2C-clock
|
||||
// guard inside its own (see ReClockI2CGuard's reentrancy note).
|
||||
uint32_t wakeUpInternal();
|
||||
|
||||
// Monotonic (millis()) timers for warmup/poll intervals. Deliberately not
|
||||
// wall-clock (getTime()) based: getTime() can jump discontinuously the moment the RTC
|
||||
// quality improves mid-session (see checkRTCQualityImproved()), which would corrupt
|
||||
|
||||
Reference in New Issue
Block a user