Browse Source

sensor/ads1x15: fix changing sensor type when reading adc

master
Maxim Prokhorov 5 years ago
parent
commit
ec37c06ba5
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      code/espurna/sensors/EmonADS1X15Sensor.h

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

@ -327,7 +327,7 @@ class EmonADS1X15Sensor : public EmonSensor {
unsigned int readADC(unsigned char channel) { unsigned int readADC(unsigned char channel) {
UNUSED(channel); UNUSED(channel);
unsigned int value = i2c_read_uint16(_address, ADS1X15_REG_POINTER_CONVERT); unsigned int value = i2c_read_uint16(_address, ADS1X15_REG_POINTER_CONVERT);
if (_type = ADS1X15_CHIP_ADS1015) value >>= ADS1015_BIT_SHIFT;
if (_type == ADS1X15_CHIP_ADS1015) value >>= ADS1015_BIT_SHIFT;
delayMicroseconds(500); delayMicroseconds(500);
return value; return value;
} }


Loading…
Cancel
Save