?? clock.c
字號:
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
clock.c
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Forrest Yu, 2005
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#include "type.h"
#include "const.h"
#include "protect.h"
#include "proto.h"
#include "string.h"
#include "proc.h"
#include "global.h"
/*======================================================================*
clock_handler
*======================================================================*/
PUBLIC void clock_handler(int irq)
{
//disp_str("#");
ticks++;
p_proc_ready->ticks--;
if (k_reenter != 0) {
//disp_str("!");
return;
}
if (p_proc_ready->ticks > 0) {
return;
}
schedule();
}
/*======================================================================*
milli_delay
*======================================================================*/
PUBLIC void milli_delay(int milli_sec)
{
int t = get_ticks();
while(((get_ticks() - t) * 1000 / HZ) < milli_sec) {}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -