-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix charge_rate when discharging #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
Could you also adapt the tests (you can run them with cargo test
on linux) and add an entry to the changelog?
96ca091
to
b659476
Compare
Done! Let me know if you’d like to see any other changes. |
Thank you! |
MAX17048 & MAX17049 report negative `CRATE` values when discharging, so interpret them as i16 instead of u16 before converting to f32. Resolves eldruin#1
b659476
to
6b2510d
Compare
Ah, forgot to Thanks for getting builds working again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
Thanks! And thanks for the library! |
You are welcome. Thanks to you too. |
As reported in #1, MAX17048 & MAX17049 yield negative
CRATE
values when discharging, so interpret them as i16 instead of u16 before converting to f32.(I’m relatively new to Rust so feel free to point me towards a different idiom to use here if you’d prefer)
Fixes #1