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

📄 cxpri_in.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 will place the task into the proper linked list
 slot, according to priority.	Remember the lower the priority
 number, the higher the priority is for this task in relationship
 to others. 
*******************************************************/
void K_I_Priority_In(tcbpointer tcbptr,byte priority)
{
	tcbpointer prevtcb;
	tcbpointer tp;

	tp = cmx_tcb;	/* address of TCB link list. */
	do /* insert new tcb at appropriate priority slot in chain...*/
		{
		prevtcb = tp;
		tp = tp->nxttcb;
		} while ((tp != cmx_tcb) && (tp->priority <= priority));
	/* We should insert it just after prevtcb, just before tp. */

	tcbptr->nxttcb = tp;			/* adjust priority slot chain */
	prevtcb->nxttcb = tcbptr;
	tcbptr->priority = priority;	/* load in task's priority */
}

⌨️ 快捷键说明

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