예제 #1
0
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);
}
예제 #2
0
파일: rtc.c 프로젝트: mholtzberg/schranke
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);
}