From 0585f21b54968827d68e2059bf74fc38cc3aef27 Mon Sep 17 00:00:00 2001 From: inmarket Date: Mon, 24 Mar 2014 07:23:39 +0000 Subject: Fix AT91SAM7 ADC bug that resulted in sometimes corrupted output git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6811 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/AT91SAM7/adc_lld.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'os') diff --git a/os/hal/platforms/AT91SAM7/adc_lld.c b/os/hal/platforms/AT91SAM7/adc_lld.c index 066e3c542..0ffea3db1 100644 --- a/os/hal/platforms/AT91SAM7/adc_lld.c +++ b/os/hal/platforms/AT91SAM7/adc_lld.c @@ -117,6 +117,7 @@ ADCDriver ADCD1; if ((isr & AT91C_ADC_EOC5)) dummy = ADCReg1->ADC_CDR5; \ if ((isr & AT91C_ADC_EOC6)) dummy = ADCReg1->ADC_CDR6; \ if ((isr & AT91C_ADC_EOC7)) dummy = ADCReg1->ADC_CDR7; \ + (void) dummy; \ } #define adc_stop() { \ adc_disable(); \ @@ -160,6 +161,9 @@ static void handleint(void) { /* Half transfer processing.*/ } else if ((isr & AT91C_ADC_ENDRX)) { + // Make sure we get a full complete next time. + ADCReg1->ADC_RNPR = 0; + ADCReg1->ADC_RNCR = 0; _adc_isr_half_code(&ADCD1); } -- cgit v1.2.3