diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-10-12 20:47:30 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-10-12 20:47:30 +0000 |
commit | ec7455babe131ee0b8a4c228ed00a02396619a7d (patch) | |
tree | a3a8fb7fd348052d3a2f52511e2673d37d1dd5f9 /os/hal/platforms/STM32/adc_lld.c | |
parent | f49c8de5b2d1a4e35bef8daa2a923f751d6e17b3 (diff) | |
download | ChibiOS-ec7455babe131ee0b8a4c228ed00a02396619a7d.tar.gz ChibiOS-ec7455babe131ee0b8a4c228ed00a02396619a7d.tar.bz2 ChibiOS-ec7455babe131ee0b8a4c228ed00a02396619a7d.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2253 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/adc_lld.c')
-rw-r--r-- | os/hal/platforms/STM32/adc_lld.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/os/hal/platforms/STM32/adc_lld.c b/os/hal/platforms/STM32/adc_lld.c index cbb206a2e..9df5bb5e1 100644 --- a/os/hal/platforms/STM32/adc_lld.c +++ b/os/hal/platforms/STM32/adc_lld.c @@ -64,47 +64,17 @@ CH_IRQ_HANDLER(DMA1_Ch1_IRQHandler) { isr = STM32_DMA1->ISR;
dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_1);
+ if ((isr & DMA_ISR_TEIF1) != 0) {
+ /* DMA error processing.*/
+ STM32_ADC1_DMA_ERROR_HOOK();
+ }
if ((isr & DMA_ISR_HTIF1) != 0) {
/* Half transfer processing.*/
- if (ADCD1.ad_grpp->acg_endcb != NULL) {
- /* Invokes the callback passing the 1st half of the buffer.*/
- ADCD1.ad_grpp->acg_endcb(&ADCD1, ADCD1.ad_samples, ADCD1.ad_depth / 2);
- }
+ _adc_isr_half_code(&ADCD1);
}
if ((isr & DMA_ISR_TCIF1) != 0) {
/* Transfer complete processing.*/
- if (!ADCD1.ad_grpp->acg_circular) {
- /* End conversion.*/
- adc_lld_stop_conversion(&ADCD1);
- ADCD1.ad_grpp = NULL;
- ADCD1.ad_state = ADC_COMPLETE;
-#if ADC_USE_WAIT
- chSysLockFromIsr();
- 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_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_endcb(&ADCD1, ADCD1.ad_samples + half, half);
- }
- else {
- /* Invokes the callback passing the whole buffer.*/
- ADCD1.ad_grpp->acg_endcb(&ADCD1, ADCD1.ad_samples, ADCD1.ad_depth);
- }
- }
- }
- if ((isr & DMA_ISR_TEIF1) != 0) {
- /* DMA error processing.*/
- STM32_ADC1_DMA_ERROR_HOOK();
+ _adc_isr_full_code(&ADCD1);
}
CH_IRQ_EPILOGUE();
|