rtc闹钟都配置好了,就是到点之后唤醒不了
===============rtc配置=======================
EX
ti_ClearITPendingBit(EXTI_Line17);
EXTI_InitStructure.EXTI_Line = EXTI_Line17;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
/*使能 RTC Wakeup Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = RTC_Al
ARM_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
//先关闭 RTC_AlarmCmd(RTC_Alarm_A,DISABLE); 才能使用RTC_SetAlarm
ret = RTC_AlarmCmd(RTC_Alarm_A,DISABLE);
printf("ret = %d
",ret);
RTC_AlarmStruct.RTC_AlarmTime.RTC_H12=RTC_HourFormat_24;
RTC_AlarmStruct.RTC_AlarmTime.RTC_Hours=9;
RTC_AlarmStruct.RTC_AlarmTime.RTC_Minutes=59;
RTC_AlarmStruct.RTC_AlarmTime.RTC_Seconds=20;
// RTC_AlarmStruct.RTC_AlarmDateWeekDay=
// RTC_AlarmStruct.RTC_AlarmDateWeekDaySel=
RTC_AlarmStruct.RTC_AlarmMask=RTC_AlarmMask_Seconds | RTC_AlarmMask_Minutes | RTC_AlarmMask_Hours;
RTC_SetAlarm(RTC_Format_BIN,RTC_Alarm_A,&RTC_AlarmStruct);
RTC_ClearFlag(RTC_FLAG_ALRAF)
===================主函数调用=========================
while(1)
PWR_EnterSTOPMode( PWR_Regulator_LowPower, PWR_STOPEntry_WFI );
//进去之后就出不来了 求指导
一周热门 更多>