__INTERRUPT __HIGH_CODE void?RTC_IRQHandler(void) { ????RTC_TRIGFunCfg(32768*10); ????RTC_ClearITFlag(RTC_TRIG_EVENT); } void?HAL_TimeInit(void) { ????uint16_t?status?=?0; #if(CLK_OSC32K) ????sys_safe_access_enable(); ????R8_CK32K_CONFIG?&=?~(RB_CLK_OSC32K_XT?|?RB_CLK_XT32K_PON); ????sys_safe_access_enable(); ????R8_CK32K_CONFIG?|=?RB_CLK_INT32K_PON; ????sys_safe_access_disable(); ????Lib_Calibration_LSI(); #else ????sys_safe_access_enable(); ????R8_CK32K_CONFIG?|=?RB_CLK_OSC32K_XT?|?RB_CLK_INT32K_PON?|?RB_CLK_XT32K_PON; ????sys_safe_access_disable(); #endif ????status?=?R8_RESET_STATUS; ????if(((status?&?0x07)?==?0x01?)||?((status?&?0x07)?==?0x03?)) ????????RTC_InitTime(2020,?1,?1,?0,?0,?0); ????TMOS_TimerInit(0); } 按鍵函數(shù) {? ????KeyCfg.KEY_Event?=?KEY_Event_SingleClick;//?響應(yīng)單擊 ????RTC_TRIGFunCfg(32768*10); ????PFIC_EnableIRQ(RTC_IRQn); ????PWR_PeriphWakeUpCfg(?ENABLE,?RB_SLP_RTC_WAKE,?Long_Delay?); ????GPIOA_ModeCfg(GPIO_Pin_All,?GPIO_ModeIN_PU); ????GPIOB_ModeCfg(GPIO_Pin_All,?GPIO_ModeIN_PU); ????LowPower_Shutdown(0); }
GPIO可以喚醒,可RTC喚不醒,但是用實(shí)例的RTC可以,不清楚哪里出了問題
熱門產(chǎn)品 :
CH390:以太網(wǎng)控制器芯片