问答

汇集网友智慧,解决技术难题

ybbo212126

TA的家园币:64  

  • G455 SLEEP 下RTC 唤醒的问题

    请教,G455SLEEP下RTC这样配置是否存在唤醒问题,我是在EXIT20配置的,RTC_SetWakeUpCounter(9)只配置了一次,是否需要在中断配置,;谢谢intmain(void){/*InitializeUSART,TX:PC10RX:PC11*/log_init();log_info("\r\nRTCInit\r\n");/*EnablePWRClock*/RCC_EnableAPB1PeriphClk(RCC_APB1_PERIPH_PWR,ENABLE);/*RTCdatetimealarmdefaultvalue*/RTC_DateAndTimeDefaultVale();/*RTCclocksourceselect*/RTC_CLKSourceConfig(RTC_CLK_SRC_TYPE_LSI,true,true);RTC_PrescalerConfig();log_info("\r\nRTCconfigured....\r\n");/*Adjusttimebyvaluesenteredbytheuseronthehyperterminal*/RTC_DateRegulate();RTC_TimeRegulate();/*wakeupclockselect*/RTC_ConfigWakeUpClock(RTC_WKUPCLK_CK_SPRE_16BITS);/*wakeuptimervalue*/RTC_SetWakeUpCounter(9);#if(RTC_ALARM_TEST_TYPE==RTC_ALARM_TEST_TYPE_IRQ)//1.AlarminterrupttestEXTI20_RTCWKUP_Configuration(ENABLE);/*EnabletheRTCWakeupInterrupt*/RTC_ConfigInt(RTC_INT_WUT,ENABLE);RTC_EnableWakeUp(ENABLE);while(1){/*Insertalongdelay*/delay(60);log_info("\r\nentersleep\r\n");/*RequesttoenterSLEEPmode*/PWR_EnterSLEEPMode(SLEEP_NOW,PWR_STOPENTRY_WFI);log_info("\r\nsleepWakeupFromRTC\r\n");voidRTC_WKUP_IRQHandler(void){if(RTC_GetITStatus(RTC_INT_WUT)!=RESET){RTC_ClrIntPendingBit(RTC_INT_WUT);EXTI_ClrITPendBit(EXTI_LINE20);}}

    2022-09-28 3