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:
parent
51526fd627
commit
d372f913ef
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue