static void vSetWakeTimeInterrupt()

in GCC/AVR_AVRDx/port.c [275:291]


static void vSetWakeTimeInterrupt(uint16_t xExpectedIdleTime)
{
    uint32_t rtc_cnt_time;

    /* compute the required  */
    rtc_cnt_time = RTC_TICKS_TO_COUNTS(xExpectedIdleTime);
    rtc_cnt_time += ulGetExternalTime();

    while (RTC.STATUS & RTC_CMPBUSY_bm)
    {
        ;
    }
    RTC.CMP = (rtc_cnt_time & 0xFFFF);

    //Enable compare interrupt
    RTC.INTCTRL |= RTC_CMP_bm;
}