diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-09-11 10:57:11 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-09-11 10:57:11 +0000 |
commit | 781b0b129cccbecba160effce8c4ddd68295b8b9 (patch) | |
tree | 4e32a7b8c14e9eb808e1ae305fcbbff76074de48 /os/hal/src | |
parent | d51840a0c799be3b684c5b379f4015475096b6b1 (diff) | |
download | ChibiOS-781b0b129cccbecba160effce8c4ddd68295b8b9.tar.gz ChibiOS-781b0b129cccbecba160effce8c4ddd68295b8b9.tar.bz2 ChibiOS-781b0b129cccbecba160effce8c4ddd68295b8b9.zip |
Fixed bug 3064204.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2175 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r-- | os/hal/src/adc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/os/hal/src/adc.c b/os/hal/src/adc.c index 23b096f3e..df8b05fd5 100644 --- a/os/hal/src/adc.c +++ b/os/hal/src/adc.c @@ -67,7 +67,9 @@ void adcObjectInit(ADCDriver *adcp) { adcp->ad_samples = NULL;
adcp->ad_depth = 0;
adcp->ad_grpp = NULL;
+#if ADC_USE_WAIT
chSemInit(&adcp->ad_sem, 0);
+#endif
}
/**
@@ -229,8 +231,10 @@ void adcStopConversion(ADCDriver *adcp) { adc_lld_stop_conversion(adcp);
adcp->ad_grpp = NULL;
adcp->ad_state = ADC_READY;
+#if ADC_USE_WAIT
chSemResetI(&adcp->ad_sem, 0);
chSchRescheduleS();
+#endif
}
else
adcp->ad_state = ADC_READY;
@@ -258,12 +262,15 @@ void adcStopConversionI(ADCDriver *adcp) { adc_lld_stop_conversion(adcp);
adcp->ad_grpp = NULL;
adcp->ad_state = ADC_READY;
+#if ADC_USE_WAIT
chSemResetI(&adcp->ad_sem, 0);
+#endif
}
else
adcp->ad_state = ADC_READY;
}
+#if ADC_USE_WAIT || defined(__DOXYGEN__)
/**
* @brief Waits for completion.
* @details If the conversion is not completed or not yet started then the
@@ -296,6 +303,7 @@ msg_t adcWaitConversion(ADCDriver *adcp, systime_t timeout) { chSysUnlock();
return RDY_OK;
}
+#endif /* ADC_USE_WAIT */
#endif /* CH_HAL_USE_ADC */
|