From 808c218d7b103b86eeae0c82acd80fe14f2fd4c3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 24 Nov 2009 21:32:19 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1324 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/io/platforms/STM32/adc_lld.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/os/io/platforms/STM32/adc_lld.c b/os/io/platforms/STM32/adc_lld.c index 567b03a2a..1aac86fe7 100644 --- a/os/io/platforms/STM32/adc_lld.c +++ b/os/io/platforms/STM32/adc_lld.c @@ -217,6 +217,9 @@ void adc_lld_start_conversion(ADCDriver *adcp) { adcp->ad_adc->SQR3 = grpp->acg_sqr3; adcp->ad_adc->CR1 = grpp->acg_cr1 | ADC_CR1_SCAN; adcp->ad_adc->CR2 = grpp->acg_cr2 | ADC_CR2_DMA | ADC_CR2_ADON; + + /* ADC start.*/ + adcp->ad_adc->CR2 |= ADC_CR2_SWSTART | ADC_CR2_EXTTRIG; } /** @@ -226,7 +229,7 @@ void adc_lld_start_conversion(ADCDriver *adcp) { */ void adc_lld_stop_conversion(ADCDriver *adcp) { - adcp->ad_adc->CR2 &= ~(ADC_CR2_SWSTART | ADC_CR2_EXTTRIG); + adcp->ad_adc->CR2 = ADC_CR2_ADON; adcp->ad_dma->CCR = 0; }