Browse Source
ina219: fix shift value (#2577)
According to the datasheet, ADC gain bits are [11...12]
pull/2578/merge
HamedTa
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
code/espurna/sensors/INA219Sensor.h
|
|
@ -258,7 +258,7 @@ private: |
|
|
|
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); |
|
|
|