stm32fxxx-hal-libraries icon indicating copy to clipboard operation
stm32fxxx-hal-libraries copied to clipboard

ADC for new HAL Library 1.7.1 not checking all flags

Open jeremyvnc opened this issue 7 years ago • 1 comments

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.

jeremyvnc avatar Aug 31 '17 23:08 jeremyvnc

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

jinhyuk-im avatar Apr 11 '18 17:04 jinhyuk-im