waitusec.c

来自「嵌入式操作系统T-Kernel 完整代码」· C语言 代码 · 共 34 行

C
34
字号
/* *---------------------------------------------------------------------- *    T-Kernel * *    Copyright (C) 2004 by Ken Sakamura. All rights reserved. *    T-Kernel is distributed under the T-License. *---------------------------------------------------------------------- * *    Version:   1.01.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2004/6/28. * *---------------------------------------------------------------------- *//* *	@(#)waitusec.c (libtk/M32104) * *	Busy loop wait time in micro-sec  */#include <basic.h>#include <sys/sysinfo.h>EXPORT void WaitUsec( UINT usec ){	UW	count = usec * SCInfo.loop64us / 64;	Asm("	loop:	addi	%0, #-1		\n"	"		bgtz	%0, loop	"		: "=r"(count)		: "0"(count)	);}

⌨️ 快捷键说明

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