?? delay.c
字號:
#include <dos.h>
#include <def.inc>
#include <func.inc>
extern UL *Tick_cnt_ptr;
/* --------------------------------------------------------------------
FUNCTION: Suspends execution for interval.
CALLS: None.
CALLED BY: This is a General-purposed routine with event flags
processing inside.
INPUT: nticks -- suspending period(Unit: TICKS=55ms).
OUTPUT: None.
RETURN: None.
-------------------------------------------------------------------- */
void delay_tick(UI nticks)
{
UL time1;
UI time;
time1 = *Tick_cnt_ptr;
time = (UI) (*Tick_cnt_ptr - time1);
while ( time<nticks )
{
check_event_flag();
time = (UI) (*Tick_cnt_ptr - time1);
}
}
/* --------------------------------------------------------------------
FUNCTION: Suspends execution for interval.
CALLS: delay();
CALLED BY: This is a General-purposed routine with event flags
processing inside.
INPUT: n_10ms -- suspending period(Unit: 10ms).
OUTPUT: None.
RETURN: None.
-------------------------------------------------------------------- */
void delay_10ms(UI n_10ms)
{
UI loop;
for (loop=0; loop<n_10ms; loop++)
{
check_event_flag();
delay(10);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -