Skip to content

Commit

Permalink
Merge pull request #1 from KlsBecker/KlsBecker-patch-1
Browse files Browse the repository at this point in the history
ina219: fix bus voltage measuring
  • Loading branch information
klsbecker authored Sep 25, 2023
2 parents b0e707a + 7376716 commit 77c9fa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/ina219/ina219.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ esp_err_t ina219_get_bus_voltage(ina219_t *dev, float *voltage)
{
CHECK_ARG(dev && voltage);

int16_t raw;
CHECK(read_reg_16(dev, REG_BUS_U, (uint16_t *)&raw));
uint16_t raw;
CHECK(read_reg_16(dev, REG_BUS_U, &raw));

*voltage = (raw >> 3) * 0.004;

Expand Down

0 comments on commit 77c9fa3

Please sign in to comment.