cxpri_in.c
来自「CMEX source code RTOS for atmel atmega12」· C语言 代码 · 共 41 行
C
41 行
/*********************************************************
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 + =
减小字号Ctrl + -
显示快捷键?