From 44b7d2957717acf3f5cbfd700afdbe9540644f95 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Wed, 12 Feb 2020 15:06:03 +0000 Subject: [PATCH] Fixed bug #1072. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13353 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/hal/include/hal_adc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/os/hal/include/hal_adc.h b/os/hal/include/hal_adc.h index ebc619d58..8bc306661 100644 --- a/os/hal/include/hal_adc.h +++ b/os/hal/include/hal_adc.h @@ -104,6 +104,7 @@ typedef struct hal_adc_configuration_group ADCConversionGroup; * @brief Type of an ADC notification callback. * * @param[in] adcp pointer to the @p ADCDriver object triggering the + * callback */ typedef void (*adccallback_t)(ADCDriver *adcp); @@ -360,9 +361,10 @@ struct hal_adc_driver { if ((adcp)->grpp->error_cb != NULL) { \ (adcp)->state = ADC_ERROR; \ (adcp)->grpp->error_cb(adcp, err); \ - if ((adcp)->state == ADC_ERROR) \ + if ((adcp)->state == ADC_ERROR) { \ (adcp)->state = ADC_READY; \ (adcp)->grpp = NULL; \ + } \ } \ else { \ (adcp)->state = ADC_READY; \