stm32: Fix ADC on stm32f042
It seems the stm32f042 chip needs a small delay during ADC enable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
9f31a35e75
commit
247cd753e2
|
@ -91,6 +91,7 @@ gpio_adc_setup(uint32_t pin)
|
|||
;
|
||||
// Enable ADC
|
||||
adc->ISR = ADC_ISR_ADRDY;
|
||||
adc->ISR; // Dummy read to make sure write is flushed
|
||||
adc->CR = CR_FLAGS | ADC_CR_ADEN;
|
||||
while (!(adc->ISR & ADC_ISR_ADRDY))
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue