📄 wvdemo.c
字号:
#include "vxWorks.h"
#include "semLib.h"
#include "msgQLib.h"
#include "taskLib.h"
#include "wvUtilLib.h"
extern int wvArgHtons;
#define MY_EVENT_ID 42
void wvDemo(void)
{
int count = 0;
SEM_ID ms;
SET_WV_UPLOAD_PATH(WvTsfsUploadPath);
wvArgHtons = 0; /* Removes htons() call for simulator. */
WV_START(WV_CLASS_3, "localhost", 6164 );
ms = semBCreate(SEM_Q_FIFO, SEM_FULL);
FOREVER
{
if (count == 5)
WV_STOP();
semTake(ms,WAIT_FOREVER);
taskDelay(2);
/* Log a user defined event */
WV_EVT_OBJ(MY_EVENT_ID, count);
semGive(ms);
taskLock();
count ++;
taskUnlock();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -