aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/STM32F0xx/adc_lld.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-08-25 08:45:58 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-08-25 08:45:58 +0000
commit6ccef4b00a5ab12265f57bcc70d7090aaf08163c (patch)
tree5d99df15de4715cb8ef2036ce6759dc0dacbf133 /os/hal/ports/STM32/STM32F0xx/adc_lld.c
parent2d9efb0eafab37e73a9be6280e677f720317d0c3 (diff)
downloadChibiOS-6ccef4b00a5ab12265f57bcc70d7090aaf08163c.tar.gz
ChibiOS-6ccef4b00a5ab12265f57bcc70d7090aaf08163c.tar.bz2
ChibiOS-6ccef4b00a5ab12265f57bcc70d7090aaf08163c.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7190 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/STM32F0xx/adc_lld.c')
-rw-r--r--os/hal/ports/STM32/STM32F0xx/adc_lld.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/os/hal/ports/STM32/STM32F0xx/adc_lld.c b/os/hal/ports/STM32/STM32F0xx/adc_lld.c
index 1cc1bdcd1..753f4ac43 100644
--- a/os/hal/ports/STM32/STM32F0xx/adc_lld.c
+++ b/os/hal/ports/STM32/STM32F0xx/adc_lld.c
@@ -245,13 +245,15 @@ void adc_lld_stop(ADCDriver *adcp) {
* @notapi
*/
void adc_lld_start_conversion(ADCDriver *adcp) {
- uint32_t mode;
+ uint32_t mode, cfgr1;
const ADCConversionGroup *grpp = adcp->grpp;
/* DMA setup.*/
- mode = adcp->dmamode;
+ mode = adcp->dmamode;
+ cfgr1 = grpp->cfgr1 | ADC_CFGR1_DMAEN;
if (grpp->circular) {
- mode |= STM32_DMA_CR_CIRC;
+ mode |= STM32_DMA_CR_CIRC;
+ cfgr1 |= ADC_CFGR1_DMACFG;
if (adcp->depth > 1) {
/* If circular buffer depth > 1, then the half transfer interrupt
is enabled in order to allow streaming processing.*/
@@ -273,8 +275,7 @@ void adc_lld_start_conversion(ADCDriver *adcp) {
adcp->adc->CHSELR = grpp->chselr;
/* ADC configuration and start.*/
- adcp->adc->CFGR1 = grpp->cfgr1 | ADC_CFGR1_CONT | ADC_CFGR1_DMACFG |
- ADC_CFGR1_DMAEN;
+ adcp->adc->CFGR1 = cfgr1;
adcp->adc->CR |= ADC_CR_ADSTART;
}