aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorinmarket <inmarket@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-03-24 07:23:39 +0000
committerinmarket <inmarket@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-03-24 07:23:39 +0000
commit0585f21b54968827d68e2059bf74fc38cc3aef27 (patch)
tree51e4362b22b0c8244ac795ed941a8962e4e08627 /os
parentabb3af9ecdd9d0057e33c6d547ec3ab6b5bd6fa1 (diff)
downloadChibiOS-0585f21b54968827d68e2059bf74fc38cc3aef27.tar.gz
ChibiOS-0585f21b54968827d68e2059bf74fc38cc3aef27.tar.bz2
ChibiOS-0585f21b54968827d68e2059bf74fc38cc3aef27.zip
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
Diffstat (limited to 'os')
-rw-r--r--os/hal/platforms/AT91SAM7/adc_lld.c4
1 files changed, 4 insertions, 0 deletions
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);
}