void rtc_init(void) { rtc_auto_awake(RCC_LSE, 0x7fff); //rtc_interrupt_enable(RTC_SEC); //nvic_enable_irq(NVIC_RTC_IRQ); //nvic_set_priority(NVIC_RTC_IRQ, 1); }
void rtc_init(void) { /* * If the RTC is pre-configured just allow access, don't reconfigure. * Otherwise enable it with the LSE as clock source and 0x7fff as * prescale value. */ rtc_auto_awake(LSE, 0x7fff); /* Without this the RTC interrupt routine will never be called. */ nvic_enable_irq(NVIC_RTC_IRQ); nvic_set_priority(NVIC_RTC_IRQ, 1); /* Enable the RTC interrupt to occur off the SEC flag. */ rtc_interrupt_enable(RTC_SEC); }