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

drivers: adc: Fix overflow calculation bug in voltage divider. #31

Conversation

petejohanson
Copy link

The calculation to adjust a voltage divider value can overflow the 32-bit max when using a large full_ohms causing the calculation to be off. Cast up to 64-bits during the calculation to avoid this.

The calculation to adjust a voltage divider value can overflow
the 32-bit max when using a large `full_ohms` causing the calculation
to be off. Cast up to 64-bits during the calculation to avoid this.

Signed-off-by: Peter Johanson <[email protected]>
@petejohanson petejohanson self-assigned this Mar 15, 2024
@petejohanson petejohanson merged commit 4d0f975 into zmkfirmware:v3.5.0+zmk-fixes Mar 15, 2024
8 of 11 checks passed
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 this pull request may close these issues.

1 participant