aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinmarket <inmarket@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-03-24 09:29:34 +0000
committerinmarket <inmarket@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-03-24 09:29:34 +0000
commitf20d6ff60cdc838987387ee8f8706f24e2a811cb (patch)
tree7fc05efbe3be30452b64971d682b21fc1b8b6b9d
parent0585f21b54968827d68e2059bf74fc38cc3aef27 (diff)
downloadChibiOS-f20d6ff60cdc838987387ee8f8706f24e2a811cb.tar.gz
ChibiOS-f20d6ff60cdc838987387ee8f8706f24e2a811cb.tar.bz2
ChibiOS-f20d6ff60cdc838987387ee8f8706f24e2a811cb.zip
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
-rw-r--r--os/hal/platforms/AT91SAM7/adc_lld.c5
1 files 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 {