cxtwatm.c

来自「上传一个带源代码的嵌入式实时多任务操作系统CMX」· C语言 代码 · 共 57 行

C
57
字号
/*********************************************************

Copyright (c) CMX Company. 1999. All rights reserved

*********************************************************/
/* version 5.30 */

#define CMXMODULE 1

#include <cxfuncs.h>	/* get cmx include header file */
#include <cxextern.h>	/* get cmx include header file */

#if (defined(CMXTRACKER) || defined(WINTRACKER))
#include <cmxtrack.h>	/* get cmx include header file */
#endif

/************************************************************
 This function allows a task to wait for the desired time
 period to expire or indefinitely. The K_Task_Wake and K_Task_Wake_Force
 function may be used to wake this task, prior to the time
 period expiring.
************************************************************/
byte K_Task_Wait(word16 timecnt)
{
	K_I_Disable_Sched();	/* set task block */
	
#if (defined(CMXTRACKER) || defined(WINTRACKER))
		if (CMXTRACKER_ON)
			{
			cmxtracker_in4(CXTWATM_CALL,0,timecnt);
			}
#endif
	/* call the function that will suspend this task, indicate the
		reason to suspend this task */
	if (K_I_Time_Common(timecnt,WAIT))
		{
#if (defined(CMXTRACKER) || defined(WINTRACKER))
		if (CMXTRACKER_ON)
			{
			cmxtracker_in1(CXTWATM_DELAY_K_ERROR);
			}
#endif
		return(K_TIMEOUT);
		}
	else
		{
#if (defined(CMXTRACKER) || defined(WINTRACKER))
		if (CMXTRACKER_ON)
			{
			cmxtracker_in1(CXTWATM_DELAY_K_OK);
			}
#endif
		return(K_OK);
		}
}

⌨️ 快捷键说明

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