|
本人在编译uC/OS-II的时候,出现了一个比较难缠的编译错误,望高手指点!
先看OS_CPU.H文件,该头文件包含与cpu有关的定义
- typedef unsigned char INT8U; //无符号8位数
复制代码
OS_CFG.H文件,是uC/OS-II的配置文件
- #define OS_MAX_EVENTS 2
- #define OS_Q_EN 1
- #define OS_MAX_QS 2
- #define OS_MBOX_EN 1
- #define OS_SEM_EN 1
- #define OS_MUTEX_EN 1
复制代码
uCOS_II.H文件
- #define OS_EVENT_EN (((OS_Q_EN > 0) && (OS_MAX_QS > 0))|| (OS_MBOX_EN > 0) || (OS_SEM_EN > 0) || (OS_MUTEX_EN > 0))
- #if (OS_EVENT_EN > 0) && (OS_MAX_EVENTS > 0)
- typedef struct {
- INT8U OSEventType; /* Type of event control block (see OS_EVENT_TYPE_???) */
- INT8U OSEventGrp; /* Group corresponding to tasks waiting for event to occur */
- INT16U OSEventCnt; /* Semaphore Count (not used if other EVENT type) */
- void *OSEventPtr; /* Pointer to message or queue structure */
- INT8U OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur */
- } OS_EVENT;
- #endif
- #if OS_MBOX_EN > 0
- typedef struct {
- void *OSMsg; /* Pointer to message in mailbox */
- INT8U OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur */
- INT8U OSEventGrp; /* Group corresponding to tasks waiting for event to occur */
- } OS_MBOX_DATA;
- #endif
- #if OS_MBOX_QUERY_EN > 0
- [color=#FF0000]INT8U OSMboxQuery(OS_EVENT *pevent, OS_MBOX_DATA *pdata);[/color]
- #endif
复制代码
INCLUDES.H文件,包含所有的头文件
- #include
- #include
- #include
复制代码
APP.C文件:应用程序
- #include
- #define TASK_STK_SIZE 512 /* Size of each task's stacks (# of WORDs) */
- OS_STK TaskStartStk[TASK_STK_SIZE];
- void TaskStart(void *data); /* Function prototypes of Startup task */
- void main (void)
- {
- OSInit(); /* Initialize uC/OS-II */
- OSTaskCreate(TaskStart, (void *)0, &TaskStartStk[TASK_STK_SIZE - 1], 0);
- OSStart(); /* Start multitasking */
- }
- void TaskStart (void *data)
- {
- }
复制代码
注意:限于篇幅,只贴出了与错误有关的代码!
编译时UCOS_II.H的INT8U OSMboxQuery(OS_EVENT *pevent, OS_MBOX_DATA *pdata);出现:..\SOURCE\UCOS_II.H(547): error C141: syntax error near ')'错误,本人不解,望高手指点,感激不尽!
|
|