Skip to content

Commit

Permalink
ina219: fix shift value (#2577)
Browse files Browse the repository at this point in the history
According to the datasheet, ADC gain bits are [11...12]
  • Loading branch information
hamed-ta authored Jan 28, 2023
1 parent 2b3b47c commit 0db47f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/espurna/sensors/INA219Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class INA219Sensor : public I2CSensor<BaseEmonSensor> {
value |= (conf.bus_mode << 7) | (conf.shunt_mode << 3);

value &= ~GainMask;
value |= (conf.gain << 12);
value |= (conf.gain << 11);

value &= ~BusRangeMask;
value |= (conf.bus_range << 13);
Expand Down

0 comments on commit 0db47f5

Please sign in to comment.