补充代码如下,每秒会被调用一次:
MX_ADC1_Init();
if(HAL_ADCEx_Calibration_Start(&hadc1,ADC_SINGLE_ENDED) != HAL_OK)
Error_Handler();
if(HAL_ADC_Start_IT(&hadc1) != HAL_OK)
Error_Handler();
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
runflag = 0;
HAL_ADCEx_EnterADCDeepPowerDownMode(&hadc1);
|