Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charge rate reports wrong values #1

Closed
DmitryNuzhdin opened this issue Aug 24, 2023 · 1 comment · Fixed by #2
Closed

Charge rate reports wrong values #1

DmitryNuzhdin opened this issue Aug 24, 2023 · 1 comment · Fixed by #2

Comments

@DmitryNuzhdin
Copy link

When the battery discharges wrong values get reported (MAX17048). The reason for that is that this register is i16 formatted in reality and has negative values when the battery discharges. But the library converts them to u16.

I know that it's an old repo, but I found this lib useful for me. Will you merge aa PR if I will make one with the fix :) ?

@eldruin
Copy link
Owner

eldruin commented Aug 29, 2023

Hi, thanks for finding it. I would certainly welcome a PR fixing that.

bencochran added a commit to bencochran/max170xx-rs that referenced this issue Dec 9, 2023
MAX17048 & MAX17049 report negative values when discharging, so interpret it as
i16 instead of u16 before converting to f32.

Resolves eldruin#1
bencochran added a commit to bencochran/max170xx-rs that referenced this issue Dec 9, 2023
MAX17048 & MAX17049 report negative `CRATE` values when discharging, so interpret them as i16
instead of u16 before converting to f32.

Resolves eldruin#1
bencochran added a commit to bencochran/max170xx-rs that referenced this issue Dec 9, 2023
MAX17048 & MAX17049 report negative `CRATE` values when discharging, so interpret them as i16
instead of u16 before converting to f32.

Resolves eldruin#1
bencochran added a commit to bencochran/max170xx-rs that referenced this issue Dec 10, 2023
MAX17048 & MAX17049 report negative `CRATE` values when discharging, so interpret them as i16
instead of u16 before converting to f32.

Resolves eldruin#1
eldruin pushed a commit that referenced this issue Dec 11, 2023
MAX17048 & MAX17049 report negative `CRATE` values when discharging, so interpret them as i16
instead of u16 before converting to f32.

Resolves #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants