cxctstp.c

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

C
54
字号
/*********************************************************

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

/******************************************************************
 stop a cyclic timer function
******************************************************************/
byte K_Timer_Stop(byte timed_num)
{
	struct _tcproc *tpptr;

	if (timed_num >= MAX_CYCLIC_TIMERS)	/* have we exceeded the maximum number */
		{
#if (defined(CMXTRACKER) || defined(WINTRACKER))
		if (CMXTRACKER_ON)
			{
			cmxtracker_in2(CXCTSTP_K_ERROR,timed_num);
			}
#endif
		return(K_ERROR);
		}
	K_I_Disable_Sched();	/* set task block */
	tpptr = &tcproc[timed_num];	/* address of cyclic timer structure. */
	if (tpptr->tproc_start)	/* see if non 0 */
		{
		tpptr->tproc_start = 0;	/* stop cyclic timer. */
		/* the following removes the cyclic timer from
			the doubly linked list of started cyclic timers. */
		tpptr->ftlink->btlink = tpptr->btlink;
		tpptr->btlink->ftlink = tpptr->ftlink;
		}
#if (defined(CMXTRACKER) || defined(WINTRACKER))
		if (CMXTRACKER_ON)
			{
			cmxtracker_in2(CXCTSTP_K_OK,timed_num);
			}
#endif
	K_I_Func_Return();	/* release task block */
	return(K_OK);	/* return good status */
}

⌨️ 快捷键说明

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