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:
parent
b6194bc0bf
commit
ab6ddb8f99
@ -2886,8 +2886,6 @@ static int adc_setup(FAR struct adc_dev_s *dev)
|
||||
return OK;
|
||||
}
|
||||
|
||||
priv->initialized += 1;
|
||||
|
||||
/* Attach the ADC interrupt */
|
||||
|
||||
#ifndef CONFIG_STM32_ADC_NOIRQ
|
||||
@ -2960,6 +2958,10 @@ static int adc_setup(FAR struct adc_dev_s *dev)
|
||||
adccmn_lock(priv, false);
|
||||
#endif
|
||||
|
||||
/* The ADC device is ready */
|
||||
|
||||
priv->initialized += 1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user