usrappinit.c
来自「基于如何开发MPC860处理器系统的核心业务模块QMC的开发程序」· C语言 代码 · 共 70 行
C
70 行
/* usrAppInit.c - stub application initialization routine */
/* Copyright 1984-1998 Wind River Systems, Inc. */
/*
modification history
--------------------
01a,02jun98,ms written
*/
/*
DESCRIPTION
Initialize user application code.
*/
/******************************************************************************
*
* usrAppInit - initialize the users application
*/
#include "taskLib.h"
#include "msgQLib.h"
MSG_Q_ID snd,rev;
void msgSnd(void);
void msgRev(void);
void usrAppInit (void)
{
int i,j;
char *conn;
int len;
j=0;
#ifdef USER_APPL_INIT
USER_APPL_INIT; /* for backwards compatibility */
#endif
DS2154_Init();
sysHdlcHwInit();
for(;;){
sprintf(conn,"xxxx Channel 1 is connecting!!%d",j++);
len = strlen(conn);
sendMsgQMC(1,len,conn);
for(i=0;i<10000;i++);
sprintf(conn,"HDLC Channel 4 is connecting!!%d",j++);
len = strlen(conn);
sendMsgQMC(4,len,conn);
}
/*
snd = msgQCreate(50,64,0x00);
rev = msgQCreate(50,64,0x00);*/
taskSpawn("send",230,0x08,4096,(FUNCPTR)msgSnd,0,0,0,0,0,0,0,0,0,0);
/*taskSpawn("receive",200,0x08,4096,(FUNCPTR)msgRev,0,0,0,0,0,0,0,0,0,0);*/
/* add application specific code here */
}
void msgSnd(void)
{
char *conn;
conn = "HDLC Channel 0 is connecting!!";
for(;;)
{
sendMsgQMC(0,30,conn);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?