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

📄 cxctcre.c

📁 CMEX source code RTOS for atmel atmega128
💻 C
字号:
/*********************************************************

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 */

#ifdef CMXTRACKER
#include <cmxtrack.h>	/* get cmx include header file */
#endif

/********************************************************************
 This function sets up the cyclic timer's event parameters.
********************************************************************/
byte K_Timer_Create(byte timed_num,byte mode,byte tskid_pri,word16 event_num)
{
	struct _tcproc *tpptr;

	if (timed_num >= MAX_CYCLIC_TIMERS)	/* have we exceeded the maximum number */
		{
#ifdef CMXTRACKER
		if (CMXTRACKER_ON)
			{
			cmxtracker_in2(CXCTCRE_K_ERROR,timed_num);
			}
#endif
		return(K_ERROR);	/* yes, return error status */
		}
	K_I_Disable_Sched();	/* set task block */
	tpptr = &tcproc[timed_num];	/* get address of cyclic timer handler */
	tpptr->mode = mode;	/* load K_Event_Signal MODE */ 
	tpptr->tskid_pri = tskid_pri;	/* load in the tasks slot number
												or priority. May not be used. */
	tpptr->event_num = event_num;	/* load in the event to be set. */
#ifdef CMXTRACKER
		if (CMXTRACKER_ON)
			{
			cmxtracker_in2(CXCTCRE_K_OK,timed_num);
			}
#endif
	K_I_Func_Return();	/* release task block */
	return(K_OK);	/* return good status */
}

⌨️ 快捷键说明

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