|
#include
#include "vxWorks.h"
#include
#include
#include "sysLib.h"
#include
#include "taskLib.h"
SEM_ID syncSem;
void inxxxx(void);
void task1(void);
void interruptxxxx(void);
#define INUM_TO_IVEC(intNum) ((VOIDFUNCPTR *) (intNum));
void usrAppInit (void)
{
#ifdef USER_APPL_INIT
USER_APPL_INIT;
#endif
SysInit();
printf(">>system inital ok!!\n");
inxxxx();
}
void inxxxx(void)
{
int x=6;
printf("1\n");
intConnect(INUM_TO_IVEC(6),(VOIDFUNCPTR)interruptxxxx,0);
printf("2\n");
syncSem = semBCreate (SEM_Q_FIFO, SEM_EMPTY);
taskSpawn("sample",100,0,20000,task1,0,0,0,0,0,0,0,0,0,0);
printf("3\n");
}
void task1(void)
{
int i;
semTake (syncSem, WAIT_FOREVER); /* 等待事件的发生 */
while(1)
{
printf("put runled post\n");
scanf("%d ",&i);
RunLED2(i);
}
}
void interruptxxxx(void)
{
semGive (syncSem); /* 通知事件的发生*/
}
编译这样错误
..\usrAppInit.c: In function `inxxxx':
..\usrAppInit.c:58: parse error before `;'
..\usrAppInit.c:61: warning: passing arg 5 of `taskSpawn' from incompatible pointer type
|
|