Zhaoqi Xu
60aa84841d
[INA226] Read the shunt voltage as a signed value ( #2410 )
...
The shunt voltage register is a 16-bit two's complement value. The
old conversion tested `shuntvolt && 0x8000` (always true for a
non-zero reading) and then negated the complement of the zero-extended
value, which gives back the raw register value. Positive readings came
out right by accident, but a reverse current was published as a large
positive current (0xFFF0 -> 1.638 A instead of -0.4 mA with the
default 0.1 ohm shunt).
Cast the register to int16_t instead.
Fixes #2395
Signed-off-by: Zhaoqi Xu <lzy00419@outlook.com >
2026-10-15 05:20:38 -05:00
..
2025-05-06 19:35:50 -05:00
2026-03-09 07:47:30 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-12-07 09:56:15 -06:00
2026-06-14 17:20:24 -05:00
2025-08-19 09:15:41 -05:00
2026-08-15 16:45:35 -05:00
2025-08-19 09:15:41 -05:00
2026-08-24 08:17:15 -05:00
2025-05-06 19:35:50 -05:00
2024-09-26 06:55:26 -05:00
2024-04-10 15:48:05 -05:00
2025-05-06 19:35:50 -05:00
2025-05-06 19:35:50 -05:00
2026-03-22 19:05:44 -05:00
2024-09-26 06:55:26 -05:00
2024-04-10 15:48:05 -05:00
2024-09-26 06:55:26 -05:00
2025-05-06 19:35:50 -05:00
2025-05-06 19:35:50 -05:00
2024-09-26 06:55:26 -05:00
2024-09-26 06:55:26 -05:00
2024-04-10 15:48:05 -05:00
2024-09-26 06:55:26 -05:00
2024-04-10 15:48:05 -05:00
2024-09-26 06:55:26 -05:00
2025-05-06 19:35:50 -05:00
2024-09-26 06:55:26 -05:00
2025-08-17 06:27:42 -05:00
2026-08-15 16:45:35 -05:00
2025-05-06 19:35:50 -05:00
2026-01-24 17:16:03 -06:00
2025-05-06 19:35:50 -05:00
2025-05-06 19:35:50 -05:00
2026-06-14 16:28:01 -05:00
2025-05-06 19:35:50 -05:00
2024-09-26 06:55:26 -05:00
2026-07-28 19:05:18 -05:00
2024-09-26 06:55:26 -05:00
2025-05-06 19:35:50 -05:00
2025-05-06 19:35:50 -05:00
2025-05-06 19:35:50 -05:00
2025-05-06 19:35:50 -05:00
2024-09-26 06:55:26 -05:00
2025-05-06 19:35:50 -05:00
2025-05-06 19:35:50 -05:00
2026-05-16 10:26:49 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2026-03-09 07:47:30 -05:00
2026-01-24 17:16:03 -06:00
2026-06-14 17:20:24 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2026-10-12 06:51:09 -05:00
2025-12-07 09:56:15 -06:00
2025-12-07 09:56:15 -06:00
2026-03-09 07:47:30 -05:00
2025-08-19 09:15:41 -05:00
2026-09-11 21:04:52 -05:00
2026-07-28 19:05:18 -05:00
2026-06-14 17:20:24 -05:00
2025-08-19 09:15:41 -05:00
2026-10-12 06:50:14 -05:00
2026-10-12 06:52:18 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2026-03-09 07:47:30 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2026-10-15 05:20:38 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2025-08-19 09:15:41 -05:00
2026-03-09 07:47:30 -05:00
2026-08-10 06:33:13 -05:00
2026-10-12 06:50:14 -05:00