/***********************************************************************
* trigger MCU enter stop mode
*/
void powerSaving(void){
//config GPIO to analog mode (zero consumption for every analog GPIO)
lightLed(LED_GREEN, false);
//HAL_ADC_DeInit(&hadc);
//clear wakeup flag
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
//call power function to enter "STOP" mode
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
//after stop, program continue run from here
//config RCC
SystemClock_Config();
//sysclkConfig_after_stop();
//adc init
HAL_ADC_DeInit(&hadc);
MX_ADC_Init();
HAL_ADCEx_Calibration_Start(&hadc, ADC_SINGLE_ENDED);
//config GPIO
}