mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-13 23:21:19 +10:00
Add SEN6x sensors (#11390)
* 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 --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
coderabbitai[bot]
parent
3b608b8fc5
commit
944fd26580
@@ -46,8 +46,8 @@ bool SFA30Sensor::initDevice(TwoWire *bus, ScanI2C::FoundDevice *dev)
|
||||
|
||||
status = 1;
|
||||
state = State::ACTIVE;
|
||||
measureStarted = getTime();
|
||||
LOG_INFO("%s: Enabled", sensorName);
|
||||
measureStarted = millis();
|
||||
LOG_INFO("%s Enabled", sensorName);
|
||||
|
||||
initI2CSensor();
|
||||
return true;
|
||||
@@ -102,7 +102,7 @@ uint32_t SFA30Sensor::wakeUp()
|
||||
#endif /* SFA30_I2C_CLOCK_SPEED */
|
||||
|
||||
state = State::ACTIVE;
|
||||
measureStarted = getTime();
|
||||
measureStarted = millis();
|
||||
return SFA30_WARMUP_MS;
|
||||
}
|
||||
|
||||
@@ -125,9 +125,7 @@ bool SFA30Sensor::isActive()
|
||||
|
||||
int32_t SFA30Sensor::pendingForReadyMs()
|
||||
{
|
||||
uint32_t now;
|
||||
now = getTime();
|
||||
uint32_t sinceHchoMeasureStarted = (now - measureStarted) * 1000;
|
||||
uint32_t sinceHchoMeasureStarted = millis() - measureStarted;
|
||||
LOG_DEBUG("%s: Since measure started: %ums", sensorName, sinceHchoMeasureStarted);
|
||||
|
||||
if (sinceHchoMeasureStarted < SFA30_WARMUP_MS) {
|
||||
|
||||
Reference in New Issue
Block a user