📄 os_macin.h
字号:
/**************** os_macIn.h**************/
/* MacroStar 1.0a */
/* Zhengyuquan,2003.7,Beijing */
/* All rights reserved */
/****************************************/
#if !(__COMMON_DEF_)
#define __COMMON_DEF_
#include <dos.h>
enum ErrorType
{
NO_ERROR =0,
WAIT_INVALID_EVENT =1, /*os_WaitEvent :无效的事件对象句柄*/
SET_INVALID_EVENT =2, /*os_SetEvent :无效的事件对象句柄*/
RESET_INVALID_EVENT =3, /*os_ResetEvent :无效的事件对象句柄*/
SET_EVENT_MODE =4, /*os_SetEvent :无效的复位模式,请使用AUTO_RESET or HANDLE_RESET模式*/
WAIT_INVALID_SEMAPHORE =5, /*os_WaitSemaphore :无效的信标对象句柄*/
RELE_INVALID_SEMAPHORE =6, /*os_ReleaseSemaphore :无效的信标对象句柄*/
RELE_SEMA_TO_NULL =7, /*os_ReleaseSemaphore :等待该信号的-个任务已不复存在*/
RESUME_INVALID_TASK =8, /*os_Resume :任务不存在*/
WAIT_INVALID_OBJECT =9, /*os_WaitObjectTimeOut:无效的对象句柄*/
KILL_INVALID_HTIMER =10, /*os_KillTimer :无效的定时器句柄*/
SET_INVALID_TIMERID =11, /*os_SetTimer :定时器ID不合法,有效值为0-31*/
POST_INVALID_MSG =12, /*os_PostMessage :无效的消息值, 有效值为0-31*/
SEND_INVALID_MSG =13, /*os_SendMessage :无效的消息值, 有效值为0-31*/
SET_INVALID_PRIORITY =14, /*os_SetStaticPriority:无效的静态优先级,有效值为0-14*/
TASK_ID_IS_USED =15, /*os_CreateTask*/
TASK_PRIO_IS_USED =16, /*os_CreateTask*/
DEL_NULL_OBJECT =17 /*os_DeleteObject*/
};
enum WorningType
{
NO_WARNING =0,
KILL_INVALID_TASK =1, /*os_Kill :任务不存在*/
NOTIFY_NULL =2, /*os_Notify :任务不存在*/
POST_MSG_TO_NULL =3, /*os_PostMessage :任务不存在*/
SEND_MSG_TO_NULL =4, /*os_SendMessage :任务不存在*/
KILL_UNUSED_TIMER =5, /*os_KillTimer :该定时器并未使用*/
DEL_WAITING_OBJECT =6, /*os_DeleteObject*/
REQ_INVALID_EVENT =7, /*os_RequireEevent*/
REQ_INVALID_SEMAPHORE =8 /*os_RequireSemaphore*/
};
enum ObjectType
{
EVENT_OBJECT,
SEMAPHORE_OBJECT
};
enum
{
os_false =0,
os_true =1
};
enum ResetEventMode
{
AUTO_RESET =0,
HANDLE_RESET =1
};
enum WairObjectRet
{
NOT_ENOUGH_TIMER,
WAIT_SUCCESS,
WAIT_TIME_OUT
};
#define MAX_PRIORITY_NUM 16
#define MAX_TASK_NUM 16
#define MAX_TIMER_NUM 16
#define MAX_OBJECT_NUM 16
#define SYSTEM_QUIT 0
#define SLEEP_ID 64
#define NULL_HOBJECT 0
#define NULL_HEVENT 0
#define NULL_HSEMAPHORE 0
#define NULL_OBJECT 0
#define NULL_TIMER 0xFF
#define HIGHBYTE( int_16_var ) *( (uchar*)(&int_16_var) + 1)
#define LOWBYTE( int_16_var ) *( (uchar*)(&int_16_var) )
#define LOCK_INT( ) disable( )
#define UNLOCK_INT( ) enable( )
#define LOCK_SCHEDULE( ) os_nLayers++
#define UNLOCK_SCHEDULE( ) os_nLayers--
#define LOCK_INT_EX( ) disable( )
#define UNLOCK_INT_EX( ) enable( )
#ifdef _DEBUG
extern void _FAR os_ASSERT( int e,int errorType);
extern void _FAR os_WARNING( int e,int warningType);
#else
#define os_ASSERT( e,errorType )
#define os_WARNING(e,worningType)
#endif
#define os_GetCurrentTaskId( ) (int)(os_pCurTCB-os_tcbs)
#define os_SetSwitchFlag( ) os_flag|=0x01;
#define ENTER_CRITICAL_SEG( ) LOCK_SCHEDULE( )
#define LEAVE_CRITICAL_SEG( ) \
{\
UNLOCK_SCHEDULE( );\
if( os_flag&0x01 )os_Schedule( );\
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -