From a9ec45714f14609ff64e3a8bbd9c63d274a67604 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 10 Mar 2013 11:14:47 +0000 Subject: Fixed bug 3607467. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5402 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32F4xx/adc_lld.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'os') diff --git a/os/hal/platforms/STM32F4xx/adc_lld.c b/os/hal/platforms/STM32F4xx/adc_lld.c index 94ab4fe2b..12e8e3329 100644 --- a/os/hal/platforms/STM32F4xx/adc_lld.c +++ b/os/hal/platforms/STM32F4xx/adc_lld.c @@ -270,7 +270,8 @@ void adc_lld_start(ADCDriver *adcp) { /* This is a common register but apparently it requires that at least one of the ADCs is clocked in order to allow writing, see bug 3575297.*/ - ADC->CCR = STM32_ADC_ADCPRE << 16; + ADC->CCR = (ADC->CCR & (ADC_CCR_TSVREFE | ADC_CCR_VBATE)) | + (STM32_ADC_ADCPRE << 16); /* ADC initial setup, starting the analog part here in order to reduce the latency when starting a conversion.*/ -- cgit v1.2.3