Skip to content

Fix analogin scaling for EFM32 target #5223

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

Merged
merged 1 commit into from
Oct 13, 2017
Merged

Conversation

seppestas
Copy link
Contributor

Fixes #5115.

analogin_read_u16 returns a value in the range 0x0000 - 0xFFF0
since the resolution of the ADC is 12 bits. However, in
analogin_read this value gets divided by 0xFFFF assuming the range
is 0x0000-0xFFFF. This causes a small error in the value returned by
AnalogIn::read for the EFM32 target.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 29, 2017

cc @stevew817 @akselsm

@seppestas
Copy link
Contributor Author

seppestas commented Sep 29, 2017

Hhm, I updated my commit to also change the comments, but apparently github didn't pick up on the forced push... probably a caching issue.

Fixes ARMmbed#5115.

`analogin_read_u16` returns a value in the range `0x0000 - 0xFFF0`
since the resolution of the ADC is 12 bits. However, in
`analogin_read` this value gets divided by `0xFFFF` assuming the range
is `0x0000-0xFFFF`. This causes a small error in the value returned by
`AnalogIn::read` for the EFM32 target.
@0xc0170
Copy link
Contributor

0xc0170 commented Oct 10, 2017

cc @stevew817 @akselsm

bump

@stevew817
Copy link
Contributor

Approved.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 11, 2017

/morph test

@mbed-ci
Copy link

mbed-ci commented Oct 11, 2017

Build : SUCCESS

Build number : 104
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5223/

Triggering tests

/test mbed-os

@mbed-ci
Copy link

mbed-ci commented Oct 12, 2017

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

Successfully merging this pull request may close these issues.

5 participants