aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/adc.c
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-28 13:39:56 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-28 13:39:56 +0000
commitfc492c6d190610cc9537360edf44d6dc5d072a2c (patch)
tree53fb1786e058f872671fb3adca4e73c708716d54 /os/hal/src/adc.c
parentda23780899ae4b9ce1bbe0cb9109da1c87fe0fa1 (diff)
parent663214d0e6728d153fd4118324e69c75c574327c (diff)
downloadChibiOS-fc492c6d190610cc9537360edf44d6dc5d072a2c.tar.gz
ChibiOS-fc492c6d190610cc9537360edf44d6dc5d072a2c.tar.bz2
ChibiOS-fc492c6d190610cc9537360edf44d6dc5d072a2c.zip
I2C. Merge code from trunk.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3263 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/adc.c')
-rw-r--r--os/hal/src/adc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/os/hal/src/adc.c b/os/hal/src/adc.c
index 4843ca90b..c375818a6 100644
--- a/os/hal/src/adc.c
+++ b/os/hal/src/adc.c
@@ -32,6 +32,10 @@
#if HAL_USE_ADC || defined(__DOXYGEN__)
/*===========================================================================*/
+/* Driver local definitions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
@@ -176,13 +180,14 @@ void adcStartConversionI(ADCDriver *adcp,
adcsample_t *samples,
size_t depth) {
+ chDbgCheckClassI();
chDbgCheck((adcp != NULL) && (grpp != NULL) && (samples != NULL) &&
((depth == 1) || ((depth & 1) == 0)),
"adcStartConversionI");
-
chDbgAssert((adcp->state == ADC_READY) ||
(adcp->state == ADC_COMPLETE),
"adcStartConversionI(), #1", "not ready");
+
adcp->samples = samples;
adcp->depth = depth;
adcp->grpp = grpp;
@@ -229,12 +234,13 @@ void adcStopConversion(ADCDriver *adcp) {
*/
void adcStopConversionI(ADCDriver *adcp) {
+ chDbgCheckClassI();
chDbgCheck(adcp != NULL, "adcStopConversionI");
-
chDbgAssert((adcp->state == ADC_READY) ||
(adcp->state == ADC_ACTIVE) ||
(adcp->state == ADC_COMPLETE),
"adcStopConversionI(), #1", "invalid state");
+
if (adcp->state != ADC_READY) {
adc_lld_stop_conversion(adcp);
adcp->grpp = NULL;