闹钟中断配置初始化:
void AlarmConfig()
{
rtc_alarm_disable(RTC_ALARM0);
rtc_flag_clear(RTC_FLAG_ALRM0);//清空中断标志
exti_flag_clear(EXTI_17);
exti_interrupt_flag_clear(EXTI_17);
nvic_irq_enable(RTC_Alarm_IRQn, 3U, 0U);
exti_init(EXTI_22, EXTI_INTERRUPT, EXTI_TRIG_RISING);//上升沿
Set_Alarm(RTC_TimeStructure.hour,RTC_TimeStructure.minute,RTC_TimeStructure.second+1);//设置闹钟
/* RTC alarm configuration */
rtc_interrupt_enable(RTC_INT_ALARM0);//使能中断
}
|