diff --git a/src/stm32/stm32h7_adc.c b/src/stm32/stm32h7_adc.c index ddec7d88..b9e14916 100644 --- a/src/stm32/stm32h7_adc.c +++ b/src/stm32/stm32h7_adc.c @@ -237,11 +237,10 @@ gpio_adc_setup(uint32_t pin) ; // Enable ADC - // "Clear the ADRDY bit in the ADC_ISR register by writing ‘1’" - adc->ISR |= ADC_ISR_ADRDY; + adc->ISR = ADC_ISR_ADRDY; adc->ISR; // Dummy read to make sure write is flushed adc->CR |= ADC_CR_ADEN; - while(!(adc->ISR & ADC_ISR_ADRDY)) + while (!(adc->ISR & ADC_ISR_ADRDY)) ; // Set ADC clock cycles sample time for every channel