代码无法一起发出,否则会丢失,希望21IC能改进。
初始化: rcu_rtc_clock_config(RCU_RTCSRC_IRC32K); //RCU_RTCSRC_IRC32K, RCU_RTCSRC_LXTAL
rcu_periph_clock_enable(RCU_RTC);
rtc_register_sync_wait();
nvic_irq_enable(RTC_WKUP_IRQn, 2);
exti_interrupt_flag_clear(EXTI_20);
exti_init(EXTI_20, EXTI_INTERRUPT, EXTI_TRIG_RISING);
rtc_wakeup_disable();
rtc_flag_clear(RTC_STAT_WTF);
rtc_wakeup_clock_set(WAKEUP_RTCCK_DIV2);
rtc_interrupt_enable(RTC_INT_WAKEUP);
|