Question
while(HAL_IS_BIT_SET(ADC->CR, ADC_CR_ADCAL)); make STM32f303 reset
when make ADC calibration, using while(HAL_IS_BIT_SET(adc->CR, ADC_CR_ADCAL)); makes system reset.
CLEAR_BIT(adc->CR, ADC_CR_ADCALDIF);//single end
SET_BIT(adc->CR, ADC_CR_ADCAL);
while(HAL_IS_BIT_SET(adc->CR, ADC_CR_ADCAL)); //make system reset
//works after replacing with following
tickstart = HAL_GetTick();
while(HAL_IS_BIT_SET(adc->CR, ADC_CR_ADCAL))
{
if((HAL_GetTick() - tickstart) > 5)
{
return;
}
}
Why? Similar happens to other command and status bit check? if these happen to you?
