#include"main.h"intmain(void){/* Reset of all peripherals, Initializes the Systick */HAL_Init();hcomp1.Instance=COMP1;/* Select COMP1 */hcomp1.Init.InputMinus=COMP_INPUT_MINUS_VREFINT;/* Negative input is VREF(1.2V) */hcomp1.Init.InputPlus=COMP_INPUT_PLUS_IO3;/* Positive input is PA1 */hcomp1.Init.OutputPol=COMP_OUTPUTPOL_NONINVERTED;/* COMP1 polarity is non-inverted */hcomp1.Init.Mode=COMP_POWERMODE_HIGHSPEED;/* COMP1 power mode is set to High speed */hcomp1.Init.Hysteresis=COMP_HYSTERESIS_DISABLE;/* Hysteresis function is disabled */hcomp1.Init.WindowMode=COMP_WINDOWMODE_DISABLE;/* Window mode is disabled */hcomp1.Init.TriggerMode=COMP_TRIGGERMODE_NONE;/* External trigger for COMP1 is disabled */hcomp1.Init.DigitalFilter=0;/* Initialize COMP1 */if(HAL_COMP_Init(&hcomp1)!=HAL_OK){APP_ErrorHandler();}/* Start COMP1 */HAL_COMP_Start(&hcomp1);while(1){}}