From ec37c06ba50ca10f8e995f9e021c85e4f08cffbd Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Thu, 17 Oct 2019 17:47:39 +0300 Subject: [PATCH] sensor/ads1x15: fix changing sensor type when reading adc --- code/espurna/sensors/EmonADS1X15Sensor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/espurna/sensors/EmonADS1X15Sensor.h b/code/espurna/sensors/EmonADS1X15Sensor.h index e50b0460..f4ff075a 100644 --- a/code/espurna/sensors/EmonADS1X15Sensor.h +++ b/code/espurna/sensors/EmonADS1X15Sensor.h @@ -327,7 +327,7 @@ class EmonADS1X15Sensor : public EmonSensor { unsigned int readADC(unsigned char channel) { UNUSED(channel); 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); return value; }