Browse Source

Error reset on _pre for different sensors

i18n
Xose Pérez 7 years ago
parent
commit
c0215f0a16
9 changed files with 17 additions and 1 deletions
  1. +1
    -0
      code/espurna/sensors/BMX280Sensor.h
  2. +1
    -0
      code/espurna/sensors/DHTSensor.h
  3. +5
    -0
      code/espurna/sensors/DallasSensor.h
  4. +2
    -0
      code/espurna/sensors/EmonADC121Sensor.h
  5. +1
    -0
      code/espurna/sensors/EmonADS1X15Sensor.h
  6. +2
    -0
      code/espurna/sensors/EmonAnalogSensor.h
  7. +2
    -0
      code/espurna/sensors/MHZ19Sensor.h
  8. +2
    -0
      code/espurna/sensors/SHT3XI2CSensor.h
  9. +1
    -1
      code/espurna/sensors/SI7021Sensor.h

+ 1
- 0
code/espurna/sensors/BMX280Sensor.h View File

@ -89,6 +89,7 @@ class BMX280Sensor : public I2CSensor {
_error = SENSOR_ERROR_UNKNOWN_ID;
return;
}
_error = SENSOR_ERROR_OK;
#if BMX280_MODE == 1
forceRead();


+ 1
- 0
code/espurna/sensors/DHTSensor.h View File

@ -80,6 +80,7 @@ class DHTSensor : public BaseSensor {
// Pre-read hook (usually to populate registers with up-to-date data)
void pre() {
_error = SENSOR_ERROR_OK;
_read();
}


+ 5
- 0
code/espurna/sensors/DallasSensor.h View File

@ -209,6 +209,11 @@ class DallasSensor : public BaseSensor {
return MAGNITUDE_NONE;
}
// Pre-read hook (usually to populate registers with up-to-date data)
void pre() {
_error = SENSOR_ERROR_OK;
}
// Current value for slot # index
double value(unsigned char index) {


+ 2
- 0
code/espurna/sensors/EmonADC121Sensor.h View File

@ -112,6 +112,8 @@ class EmonADC121Sensor : public EmonSensor {
last = millis();
#endif
_error = SENSOR_ERROR_OK;
}
// Type for slot # index


+ 1
- 0
code/espurna/sensors/EmonADS1X15Sensor.h View File

@ -241,6 +241,7 @@ class EmonADS1X15Sensor : public EmonSensor {
#endif
}
last = millis();
_error = SENSOR_ERROR_OK;
}
// Current value for slot # index


+ 2
- 0
code/espurna/sensors/EmonAnalogSensor.h View File

@ -94,6 +94,8 @@ class EmonAnalogSensor : public EmonSensor {
last = millis();
#endif
_error = SENSOR_ERROR_OK;
}
// Current value for slot # index


+ 2
- 0
code/espurna/sensors/MHZ19Sensor.h View File

@ -197,6 +197,8 @@ class MHZ19Sensor : public BaseSensor {
_error = SENSOR_ERROR_OUT_OF_RANGE;
}
} else {
_error = SENSOR_ERROR_CRC;
}
}


+ 2
- 0
code/espurna/sensors/SHT3XI2CSensor.h View File

@ -66,6 +66,8 @@ class SHT3XI2CSensor : public I2CSensor {
// Pre-read hook (usually to populate registers with up-to-date data)
void pre() {
_error = SENSOR_ERROR_OK;
unsigned char buffer[6];
#if I2C_USE_BRZO


+ 1
- 1
code/espurna/sensors/SI7021Sensor.h View File

@ -93,9 +93,9 @@ class SI7021Sensor : public I2CSensor {
_error = SENSOR_ERROR_UNKNOWN_ID;
if (_chip == 0) return;
_error = SENSOR_ERROR_OK;
double value;
_error = SENSOR_ERROR_OK;
value = _read(SI7021_CMD_TMP_NOHOLD);
if (_error != SENSOR_ERROR_OK) return;


Loading…
Cancel
Save