|
发表于 2018-9-18 10:06:02
|
显示全部楼层
看了下HAL_ADC_Init的源码。
while(wait_loop_index != 0) 就是个软件延迟等待。
难道是下面这个判断后退出了,那就延迟它10秒,看看是否还正常。
- /* Verification that ADC voltage regulator is correctly enabled, whether */
- /* or not ADC is coming from state reset (if any potential problem of */
- /* clocking, voltage regulator would not be enabled). */
- if (HAL_IS_BIT_CLR(hadc->Instance->CR, ADC_CR_ADVREGEN))
- {
- /* Update ADC state machine to error */
- SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL);
- /* Set ADC error code to ADC IP internal error */
- SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL);
- tmp_hal_status = HAL_ERROR;
- }
复制代码
|
|