From f20d6ff60cdc838987387ee8f8706f24e2a811cb Mon Sep 17 00:00:00 2001 From: inmarket Date: Mon, 24 Mar 2014 09:29:34 +0000 Subject: [PATCH] Update to support changes to ADC api from 2.6.2 git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6814 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/AT91SAM7/adc_lld.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/os/hal/platforms/AT91SAM7/adc_lld.c b/os/hal/platforms/AT91SAM7/adc_lld.c index 0ffea3db1..25fb4b5fa 100644 --- a/os/hal/platforms/AT91SAM7/adc_lld.c +++ b/os/hal/platforms/AT91SAM7/adc_lld.c @@ -261,6 +261,7 @@ void adc_lld_stop(ADCDriver *adcp) { */ void adc_lld_start_conversion(ADCDriver *adcp) { uint32_t i; + (void) adcp; /* Make sure everything is stopped first */ adc_stop(); @@ -289,8 +290,8 @@ void adc_lld_start_conversion(ADCDriver *adcp) { /* Set up the DMA */ ADCReg1->ADC_RPR = (uint32_t)ADCD1.samples; - if (adcp->depth <= 1) { - ADCReg1->ADC_RCR = ADCD1.grpp->num_channels; + if (ADCD1.depth <= 1 || !ADCD1.grpp->circular) { + ADCReg1->ADC_RCR = ADCD1.depth * ADCD1.grpp->num_channels; ADCReg1->ADC_RNPR = 0; ADCReg1->ADC_RNCR = 0; } else {