📄 os_sign.c
字号:
/**************** os_sign.c**************/
/* MacroStar 1.0a */
/* Zhengyuquan,2003.7,Beijing */
/* All rights reserved */
/****************************************/
#include "mStar.h"
/*
************************************************************
*
*
*
************************************************************
*/
void STDCALL _FAR os_WaitORSignal( volatile uint_16 *pSignal,uint_16 acceptMask,uint_16 urgentMask )
{
uint_16 temp;
LOCK_INT( );
while( !( temp = (*pSignal)&acceptMask ) )
{
os_rdyState &= ~os_curPrioMask;
os_rdyhState&= ~os_curPrioMask;
UNLOCK_INT( );
os_Schedule( );
LOCK_INT( );
}
if( !(temp & urgentMask) )
{
os_rdyState |= os_curPrioMask;/*robust code*/
os_rdyhState &= ~os_curPrioMask;
}
UNLOCK_INT( );
}
/*
************************************************************
*
*
*
************************************************************
*/
void STDCALL _FAR os_Notify( uchar taskId,BOOL isUrgent )
{
uint_16 taskMask;
os_WARNING( !(os_tcbState&os_maskTable[taskId]),NOTIFY_NULL);
LOCK_INT_EX( );
taskMask = os_maskTable[ os_tcbs[taskId].priority ];
if( isUrgent )
os_rdyhState |= taskMask;
else
os_rdyState |= taskMask;
UNLOCK_INT_EX( );
os_SetSwitchFlag( );
}
/*
************************************************************
*
*
*
************************************************************
*/
void STDCALL _FAR os_WaitANDSignal(volatile uint_16 *pSignal,uint_16 acceptMask )
{
LOCK_INT( );
while( (*pSignal & acceptMask) != acceptMask )
{
os_rdyState &= ~os_curPrioMask;
os_rdyhState&= ~os_curPrioMask;
UNLOCK_INT( );
os_Schedule( );
LOCK_INT( );
}
UNLOCK_INT( );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -