Skip to content

Commit

Permalink
fix wrong ADC state check
Browse files Browse the repository at this point in the history
see also: MaJerle#28
  • Loading branch information
alpo committed Apr 19, 2019
1 parent 210e4fd commit 17ed411
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 00-STM32_LIBRARIES/tm_stm32_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ uint16_t TM_ADC_Read(ADC_TypeDef* ADCx, TM_ADC_Channel_t channel) {
HAL_ADC_PollForConversion(&AdcHandle, 10);

/* Check if the continous conversion of regular channel is finished */
if (HAL_ADC_GetState(&AdcHandle) == HAL_ADC_STATE_EOC_REG) {
if (HAL_ADC_GetState(&AdcHandle) & HAL_ADC_STATE_EOC_REG) {
/* Get the converted value of regular channel */
return HAL_ADC_GetValue(&AdcHandle);
}
Expand Down

0 comments on commit 17ed411

Please sign in to comment.