mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 17:48:54 +08:00
arch/arm/src/stm32/stm32_adc.c: fix ADC setup logic
Increase the initialization counter after initialization is complete, otherwise the logic in adc_reset() will not execute correctly
This commit is contained in:
committed by
Abdelatif Guettouche
parent
b6194bc0bf
commit
ab6ddb8f99
@@ -2886,8 +2886,6 @@ static int adc_setup(FAR struct adc_dev_s *dev)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->initialized += 1;
|
|
||||||
|
|
||||||
/* Attach the ADC interrupt */
|
/* Attach the ADC interrupt */
|
||||||
|
|
||||||
#ifndef CONFIG_STM32_ADC_NOIRQ
|
#ifndef CONFIG_STM32_ADC_NOIRQ
|
||||||
@@ -2960,6 +2958,10 @@ static int adc_setup(FAR struct adc_dev_s *dev)
|
|||||||
adccmn_lock(priv, false);
|
adccmn_lock(priv, false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* The ADC device is ready */
|
||||||
|
|
||||||
|
priv->initialized += 1;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user