diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-10-12 17:59:47 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-10-12 17:59:47 +0000 |
commit | eaaf043cdab72623a15c957f44496b7bd0bd9873 (patch) | |
tree | cf7509640c9f62e6423cea9220f336ed1a99fd1a /os/hal/platforms | |
parent | 935e2fb27f56a3b81d4161d65e116e9da4fe441c (diff) | |
download | ChibiOS-eaaf043cdab72623a15c957f44496b7bd0bd9873.tar.gz ChibiOS-eaaf043cdab72623a15c957f44496b7bd0bd9873.tar.bz2 ChibiOS-eaaf043cdab72623a15c957f44496b7bd0bd9873.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2251 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms')
-rw-r--r-- | os/hal/platforms/STM32/adc_lld.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/os/hal/platforms/STM32/adc_lld.c b/os/hal/platforms/STM32/adc_lld.c index c6db10346..cbb206a2e 100644 --- a/os/hal/platforms/STM32/adc_lld.c +++ b/os/hal/platforms/STM32/adc_lld.c @@ -66,9 +66,9 @@ CH_IRQ_HANDLER(DMA1_Ch1_IRQHandler) { dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_1);
if ((isr & DMA_ISR_HTIF1) != 0) {
/* Half transfer processing.*/
- if (ADCD1.ad_grpp->acg_callback != NULL) {
+ if (ADCD1.ad_grpp->acg_endcb != NULL) {
/* Invokes the callback passing the 1st half of the buffer.*/
- ADCD1.ad_grpp->acg_callback(&ADCD1, ADCD1.ad_samples, ADCD1.ad_depth / 2);
+ ADCD1.ad_grpp->acg_endcb(&ADCD1, ADCD1.ad_samples, ADCD1.ad_depth / 2);
}
}
if ((isr & DMA_ISR_TCIF1) != 0) {
@@ -80,20 +80,25 @@ CH_IRQ_HANDLER(DMA1_Ch1_IRQHandler) { ADCD1.ad_state = ADC_COMPLETE;
#if ADC_USE_WAIT
chSysLockFromIsr();
- chSemResetI(&ADCD1.ad_sem, 0);
+ if (ADCD1.ad_thread != NULL) {
+ Thread *tp = ADCD1.ad_thread;
+ ADCD1.ad_thread = NULL;
+ tp->p_u.rdymsg = RDY_OK;
+ chSchReadyI(tp);
+ }
chSysUnlockFromIsr();
#endif
}
/* Callback handling.*/
- if (ADCD1.ad_grpp->acg_callback != NULL) {
+ if (ADCD1.ad_grpp->acg_endcb != NULL) {
if (ADCD1.ad_depth > 1) {
/* Invokes the callback passing the 2nd half of the buffer.*/
size_t half = ADCD1.ad_depth / 2;
- ADCD1.ad_grpp->acg_callback(&ADCD1, ADCD1.ad_samples + half, half);
+ ADCD1.ad_grpp->acg_endcb(&ADCD1, ADCD1.ad_samples + half, half);
}
else {
/* Invokes the callback passing the whole buffer.*/
- ADCD1.ad_grpp->acg_callback(&ADCD1, ADCD1.ad_samples, ADCD1.ad_depth);
+ ADCD1.ad_grpp->acg_endcb(&ADCD1, ADCD1.ad_samples, ADCD1.ad_depth);
}
}
}
|