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:
@@ -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))
|
||||
;
|
||||
|
Reference in New Issue
Block a user