stm32: Don't use read-modify-write on ISR register in stm32h7_adc.c

Bits are cleared in the ISR register by writing 1, not by masking.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-12-14 09:53:06 -05:00
parent 51526fd627
commit d372f913ef
1 changed files with 2 additions and 3 deletions

View File

@ -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