/********************************************************************************************************* ** Function name: enter_low_power_mode ** Descriptions: enter_low_power_mode ** input parameters: none ** output parameters: none ** Returned value: none *********************************************************************************************************/ void enter_low_power_mode(POWER_MODE mode) { switch(mode) { case SLEEP: PWR_EnterSLEEPMode(PWR_Regulator_ON,PWR_SLEEPEntry_WFI); break; case STOP: PWR_EnterSTOPMode(PWR_Regulator_ON, PWR_STOPEntry_WFI); break; case LPSTOP: PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI); break; case STANDBY: PWR_EnterSTANDBYMode(); PWR_WakeUpPinCmd(ENABLE); break; default: break; } }
void main(void) { BSP_Init(); HrSensor_Init(); SampleChannel_Init(); AGC_Init(); USBAPP_Init(); Network_Init(); HrSensor_Enable(); Sample_Start(); while (1) { Network_Routine(); HrSensor_Measure(); AGC_Control(); PWR_EnterSLEEPMode(0,PWR_SLEEPEntry_WFI); } }
void Sys_SleepMode(void) { PWR_EnterSLEEPMode(PWR_SLEEPONEXIT_Reset, PWR_SLEEPEntry_WFI); }