⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delay.c

📁 BC3.1编译,小交换机计费系统.使用Dos做出如此好的界面,少有.
💻 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 + -