diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-11-28 18:52:32 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-11-28 18:52:32 +0000 |
commit | eb2bcc41f222ebb876e25eec3642dce3cdf0236e (patch) | |
tree | b055ff6135ffc8007251b2e4e5605b6cfb10a24c /os/hal | |
parent | 5af98ce005cfffc0f19b7c14c048b511e35efe12 (diff) | |
download | ChibiOS-eb2bcc41f222ebb876e25eec3642dce3cdf0236e.tar.gz ChibiOS-eb2bcc41f222ebb876e25eec3642dce3cdf0236e.tar.bz2 ChibiOS-eb2bcc41f222ebb876e25eec3642dce3cdf0236e.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1338 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r-- | os/hal/platforms/STM32/adc_lld.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/os/hal/platforms/STM32/adc_lld.c b/os/hal/platforms/STM32/adc_lld.c index c2f2e91f9..2562988f5 100644 --- a/os/hal/platforms/STM32/adc_lld.c +++ b/os/hal/platforms/STM32/adc_lld.c @@ -60,6 +60,8 @@ CH_IRQ_HANDLER(Vector6C) { CH_IRQ_PROLOGUE();
isr = DMA1->ISR;
+ DMA1->IFCR |= DMA_IFCR_CGIF1 | DMA_IFCR_CTCIF1 |
+ DMA_IFCR_CHTIF1 | DMA_IFCR_CTEIF1;
if ((isr & DMA_ISR_HTIF1) != 0) {
/* Half transfer processing.*/
if (ADCD1.ad_callback != NULL) {
@@ -74,7 +76,9 @@ CH_IRQ_HANDLER(Vector6C) { adc_lld_stop_conversion(&ADCD1);
ADCD1.ad_grpp = NULL;
ADCD1.ad_state = ADC_READY;
+ chSysLockFromIsr();
chSemResetI(&ADCD1.ad_sem, 0);
+ chSysUnlockFromIsr();
}
/* Callback handling.*/
if (ADCD1.ad_callback != NULL) {
@@ -84,7 +88,7 @@ CH_IRQ_HANDLER(Vector6C) { ADCD1.ad_callback(ADCD1.ad_samples + half, half);
}
else {
- /* Invokes the callback passing the while buffer.*/
+ /* Invokes the callback passing the whole buffer.*/
ADCD1.ad_callback(ADCD1.ad_samples, ADCD1.ad_depth);
}
}
@@ -93,8 +97,6 @@ CH_IRQ_HANDLER(Vector6C) { /* DMA error processing.*/
STM32_ADC1_DMA_ERROR_HOOK();
}
- DMA1->IFCR |= DMA_IFCR_CGIF1 | DMA_IFCR_CTCIF1 |
- DMA_IFCR_CHTIF1 | DMA_IFCR_CTEIF1;
CH_IRQ_EPILOGUE();
}
|