From 6a0fb115c3242e00e374488e57a95b1f098845b2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 31 Dec 2012 09:33:20 +0000 Subject: First tests running and working. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5002 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32F3xx/adc_lld.c | 5 ++--- os/hal/platforms/STM32F3xx/adc_lld.h | 14 +++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'os/hal') diff --git a/os/hal/platforms/STM32F3xx/adc_lld.c b/os/hal/platforms/STM32F3xx/adc_lld.c index 22b5bfcad..0d5bed09d 100644 --- a/os/hal/platforms/STM32F3xx/adc_lld.c +++ b/os/hal/platforms/STM32F3xx/adc_lld.c @@ -474,14 +474,13 @@ void adc_lld_start_conversion(ADCDriver *adcp) { dmamode = adcp->dmamode; ccr = grpp->ccr | (adcp->adcc->CCR & (ADC_CCR_CKMODE_MASK | ADC_CCR_MDMA_MASK)); - cfgr = grpp->cfgr; + cfgr = grpp->cfgr | ADC_CFGR_CONT | ADC_CFGR_DMAEN; if (grpp->circular) { dmamode |= STM32_DMA_CR_CIRC; #if STM32_ADC_DUAL_MODE ccr |= ADC_CCR_DMACFG_CIRCULAR; - cfgr |= ADC_CFGR_CONT; #else - cfgr |= ADC_CFGR_CONT | ADC_CFGR_DMACFG_CIRCULAR | ADC_CFGR_DMAEN; + cfgr |= ADC_CFGR_DMACFG_CIRCULAR; #endif } diff --git a/os/hal/platforms/STM32F3xx/adc_lld.h b/os/hal/platforms/STM32F3xx/adc_lld.h index 140033a77..127678595 100644 --- a/os/hal/platforms/STM32F3xx/adc_lld.h +++ b/os/hal/platforms/STM32F3xx/adc_lld.h @@ -83,13 +83,6 @@ #define ADC_CFGR1_RES_6BIT (3 << 3) /** @} */ -/** - * @name Threashold register initializer - * @{ - */ -#define ADC_TR(low, high) (((uint32_t)(high) << 16) | (uint32_t)(low)) -/** @} */ - /** * @name CFGR register configuration helpers * @{ @@ -530,6 +523,13 @@ struct ADCDriver { /* Driver macros. */ /*===========================================================================*/ +/** + * @name Threashold register initializer + * @{ + */ +#define ADC_TR(low, high) (((uint32_t)(high) << 16) | (uint32_t)(low)) +/** @} */ + /** * @name Sequences building helper macros * @{ -- cgit v1.2.3