1.
??cfg.WakeUpTime?=?WAKE_UP_RTC_MAX_TIME;
??cfg.sleepCB?=?CH57X_LowPower;????//?啟用睡眠
這個(gè)WAKE_UP_RTC_MAX_TIME是不是作為CH57X_LowPower()函數(shù)的參數(shù)傳入了?還是在協(xié)議棧中做了別的處理
2.
u32?CH57X_LowPower(?u32?time?)
{
#if?(defined?(HAL_SLEEP))?&&?(HAL_SLEEP?==?TRUE)
??u32?tmp,?irq_status;
??SYS_DisableAllIrq(?&irq_status?);
??tmp?=?RTC_GetCycle32k();
??if?(?(?time?<?tmp?)?||?(?(?time?-?tmp?)?<?30?)?)
??{????//?檢測睡眠的最短時(shí)間
????SYS_RecoverIrq(?irq_status?);
????return?2;
??}
??RTC_SetTignTime(?time?);
??SYS_RecoverIrq(?irq_status?);
#if(?DEBUG?==?Debug_UART1?)??//?使用其他串口輸出打印信息需要修改這行代碼
??while(?(?R8_UART1_LSR?&?RB_LSR_TX_ALL_EMP?)?==?0?)
????__nop();
#endif
//?LOW?POWER-sleep模式
??if?(?!RTCTigFlag?)
??{
????LowPower_Sleep(?RB_PWR_RAM2K?|?RB_PWR_RAM16K?|?RB_PWR_EXTEND?);
#if?(defined?(DCDC_ENABLE))?&&?(DCDC_ENABLE?==?TRUE)
????PWR_DCDCCfg(?ENABLE?);
#endif
????time?+=?WAKE_UP_RTC_MAX_TIME;
????if(?time?>?0xA8C00000?)???time?-=?0xA8C00000;
????RTC_SetTignTime(?time?);
????LowPower_Idle();
????HSECFG_Current(?HSE_RCur_100?);?????//?降為額定電流(低功耗函數(shù)中提升了HSE偏置電流)
??}
??else
??{
????return?3;
??}
#endif
??return?0;
}
這個(gè)函數(shù)中,執(zhí)行LowPower_Sleep()進(jìn)入睡眠,后邊?LowPower_Idle()函數(shù)是做什么用的?