cxmsack.c

来自「CMEX source code RTOS for atmel atmega12」· C语言 代码 · 共 46 行

C
46
字号
/*********************************************************

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 allows a task that recieved a message to go wake
 the task that sent this message, if the task is waiting for an
 acknowledgement.
*****************************************************************/
byte K_Mesg_Ack_Sender(void)
{
	K_I_Disable_Sched();	/* set task block. */
	if (activetcb->mesg_sender)	/* see if message was sent by a task. */
		{
		/* see if the task that sent message waiting for acknowledgement. */
		if (activetcb->mesg_sender->tcbstate & SEND_MESG)	
			{
			activetcb->mesg_sender->tcbstate = RESUME; /* yes, wake task. */
			/* see if this task has a higher priority, then current running task. */
			if (activetcb->mesg_sender->priority < active_priority)
				PREEMPTED;	/* yes, so set the preempted scheduling flag */
#ifdef CMXTRACKER
		if (CMXTRACKER_ON)
			{
			cmxtracker_in2(CXMSACK_K_OK,(byte)(activetcb->mesg_sender - cmx_tcb));
			}
#endif
			}
		}
	K_I_Func_Return();	/* release task block. */
	return(K_OK);	/* always return good status */
}

⌨️ 快捷键说明

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