From 2a74bb8d6c4e707e58b198ed5a1b69199dcb9103 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 30 Sep 2012 15:40:06 +0000 Subject: Updated STM32F1, F2, F4, L1 ADC drivers to allow HW triggering. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4728 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32L1xx/adc_lld.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'os/hal/platforms/STM32L1xx') diff --git a/os/hal/platforms/STM32L1xx/adc_lld.c b/os/hal/platforms/STM32L1xx/adc_lld.c index cd24b2583..dead7d635 100644 --- a/os/hal/platforms/STM32L1xx/adc_lld.c +++ b/os/hal/platforms/STM32L1xx/adc_lld.c @@ -232,7 +232,11 @@ void adc_lld_start_conversion(ADCDriver *adcp) { /* ADC configuration and start, the start is performed using the method specified in the CR2 configuration, usually ADC_CR2_SWSTART.*/ adcp->adc->CR1 = grpp->cr1 | ADC_CR1_OVRIE | ADC_CR1_SCAN; - adcp->adc->CR2 = grpp->cr2 | ADC_CR2_CONT | ADC_CR2_DMA | + if ((grpp->cr2 & ADC_CR2_SWSTART) == 0) + adcp->adc->CR2 = grpp->cr2 | ADC_CR2_CONT | ADC_CR2_DMA | + ADC_CR2_DDS | ADC_CR2_ADON; + else + adcp->adc->CR2 = grpp->cr2 | ADC_CR2_DMA | ADC_CR2_DDS | ADC_CR2_ADON; } -- cgit v1.2.3