Skip to content

Commit de8a0f3

Browse files
committed
fix INA228 negative current calculations
1 parent fcc92cd commit de8a0f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/INA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ int32_t INA_Class::getBusMicroAmps(const uint8_t deviceNumber) {
701701
raw = raw >> 4;
702702
} // if-then negative
703703

704-
microAmps = ((int64_t)raw * (int64_t)ina.current_LSB) / 1000ULL;
704+
microAmps = ((int64_t)raw * (int64_t)ina.current_LSB) / 1000LL;
705705
break;
706706
default:
707707
microAmps = (int64_t)readWord(ina.currentRegister, ina.address) * (int64_t)ina.current_LSB /

0 commit comments

Comments
 (0)