main.c

来自「T-kernel Tcp/ip Protocol Stack Sample」· C语言 代码 · 共 60 行

C
60
字号
/* *  Copyright (C) 2004 MITSUBISHI ELECTRIC CORPORATION and *  RENESAS SOLUTIONS CORPORATION and *  RENESAS TECHNOLOGY CORPORATION *  All rights reserved. * *  Performance test program used for TCP/IP subsystem. */#include <basic.h>#include <tk/tkernel.h>#define INIT_TASK_PRIO		10#define INIT_TASK_STACK		0x10400	/* 65KB */extern void _InitLibtk(void);extern int renesas_tcpip_ifconfig(void);extern void test_task(int, void *);int main(void){	T_CTSK pk_ctsk;	int tid;	int ret;	ER ercd = E_OK;	tm_putstring("perftest is loadded.\n");	/* initialize T-Kernel library for using memset() */	_InitLibtk();	/* set my IP address */	ret = renesas_tcpip_ifconfig();	if (ret == -1) {		tm_putstring("renesas_tcpip_ifconfig() is NG.\n");		return;	} else {		tm_putstring("renesas_tcpip_ifconfig() is OK.\n");	}	/* create user "init" task */	memset((char *)&pk_ctsk, 0, sizeof(pk_ctsk));	pk_ctsk.exinf = (VP)0;	pk_ctsk.tskatr = (ATR)TA_HLNG;	pk_ctsk.task = (FP)test_task;	pk_ctsk.itskpri = (PRI)INIT_TASK_PRIO;	pk_ctsk.stksz = (INT)INIT_TASK_STACK;	tid = tk_cre_tsk(&pk_ctsk);	if (tid < E_OK) goto error2;	ercd = tk_sta_tsk(tid, (INT)0);error2:	tk_slp_tsk(TMO_FEVR);	return;}/* EOF */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?