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:
raiden00pl 2020-08-06 15:02:41 +02:00 committed by Abdelatif Guettouche
parent b6194bc0bf
commit ab6ddb8f99

View File

@ -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;
}