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

ADC for new HAL Library 1.7.1 not checking all flags #23

Open
jeremyvnc opened this issue Aug 31, 2017 · 1 comment
Open

ADC for new HAL Library 1.7.1 not checking all flags #23

jeremyvnc opened this issue Aug 31, 2017 · 1 comment

Comments

@jeremyvnc
Copy link
Contributor

Found a bug in the TM_ADC_Read function where at the end of the conversion, it checks the EOC flag. Apparently in the latest HAL that you support (1.7.1), this is not the only flag set now as the READY state is also set.

I fixed it on line 175 of tm_stm32_adc.c by checking for that flag as a flag instead as the equal value:
if (HAL_ADC_GetState(&AdcHandle) & HAL_ADC_STATE_EOC_REG == HAL_ADC_STATE_EOC_REG) {

This fixed the issue. I would do a pull request but my github is messed up at the moment.

@jinhyuk-im
Copy link
Contributor

@jeremyvnc or, I think #28 can fix this issue.

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

No branches or pull requests

2 participants