diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-23 20:38:42 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-23 20:38:42 +0000 |
commit | 09d93604e7d02274f433d0854f9bfdfcab53cc9f (patch) | |
tree | 4c4a69af12e6cfe6b9ce8de482a9c3e8857300b3 | |
parent | a24fe0108e2f7e05db454048ccf3ae9262109bb4 (diff) | |
download | ChibiOS-09d93604e7d02274f433d0854f9bfdfcab53cc9f.tar.gz ChibiOS-09d93604e7d02274f433d0854f9bfdfcab53cc9f.tar.bz2 ChibiOS-09d93604e7d02274f433d0854f9bfdfcab53cc9f.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3386 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/platforms/STM32L1xx/adc_lld.c | 5 | ||||
-rw-r--r-- | testhal/STM32L1xx/ADC/main.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/os/hal/platforms/STM32L1xx/adc_lld.c b/os/hal/platforms/STM32L1xx/adc_lld.c index 74c9a6ee3..dfd1883f0 100644 --- a/os/hal/platforms/STM32L1xx/adc_lld.c +++ b/os/hal/platforms/STM32L1xx/adc_lld.c @@ -213,7 +213,8 @@ void adc_lld_start_conversion(ADCDriver *adcp) { adcp->adc->SMPR1 = grpp->smpr1; /* Writing SMPRx requires ADON=0. */
adcp->adc->SMPR2 = grpp->smpr2;
adcp->adc->SMPR3 = grpp->smpr3;
- adcp->adc->CR2 = grpp->cr2 | ADC_CR2_DMA | ADC_CR2_CONT | ADC_CR2_ADON;
+ adcp->adc->CR2 = grpp->cr2 | ADC_CR2_DMA | ADC_CR2_DDS | ADC_CR2_CONT |
+ ADC_CR2_ADON;
adcp->adc->SQR1 = grpp->sqr1;
adcp->adc->SQR2 = grpp->sqr2;
adcp->adc->SQR3 = grpp->sqr3;
@@ -224,7 +225,7 @@ void adc_lld_start_conversion(ADCDriver *adcp) { while ((adcp->adc->SR & ADC_SR_ADONS) == 0)
;
/* ADC start by raising ADC_CR2_SWSTART.*/
- adcp->adc->CR2 = grpp->cr2 | ADC_CR2_SWSTART | ADC_CR2_DMA |
+ adcp->adc->CR2 = grpp->cr2 | ADC_CR2_SWSTART | ADC_CR2_DMA | ADC_CR2_DDS |
ADC_CR2_CONT | ADC_CR2_ADON;
}
diff --git a/testhal/STM32L1xx/ADC/main.c b/testhal/STM32L1xx/ADC/main.c index c7c7622a8..706ec690e 100644 --- a/testhal/STM32L1xx/ADC/main.c +++ b/testhal/STM32L1xx/ADC/main.c @@ -78,7 +78,7 @@ static msg_t Thread1(void *arg) { while (TRUE) {
palSetPad(GPIOB, GPIOB_LED4);
chThdSleepMilliseconds(500);
- palSetPad(GPIOB, GPIOB_LED4);
+ palClearPad(GPIOB, GPIOB_LED4);
chThdSleepMilliseconds(500);
}
}
|