interrupts.c

来自「KaOS is a real-time operating system tha」· C语言 代码 · 共 29 行

C
29
字号
interrupt [TIM0_COMP] void os_timer0_comp(void)
{
    if (g_threadcount > 1)
    {
        os_schedule();        
    }
}
/*
interrupt [TIM2_COMP] void os_timer2_comp(void)
{
    // for each timer, see if it's time is up
    os_thread *temp_thread;
    os_timer2 *temp_timer;
    
    temp_thread = g_usedthreads;
    
    while (temp_thread != NULL)
    {
        //temp_timer->progress -= g_timer2_gcd; // subtract the greatest common denominator
        temp_timer = temp_thread->event_timer2;
        if (temp_timer != NULL && temp_timer->ready != 1 && temp_timer->progress <= 0)
        {
            temp_timer->ready = 1;
            temp_timer->progress = temp_timer->delay;
        }
        temp_thread = temp_thread->next;
    }
}
*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?