userinit.c

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

C
37
字号
/* *   Copyright (C) 2004 MITSUBISHI ELECTRIC CORPORATION and *   RENESAS SOLUTIONS CORPORATION and *   RENESAS TECHNOLOGY CORPORATION *   All Rights Reserved. * *   User initialize program to load some user programs automatically. */#include <tk/tkernel.h>#include "register_prog.h"int userinit(int flag){	int i;	for (i=0; i < sizeof(prog_addr)/sizeof(prog_addr[0]); i++) {		if (prog_addr[i] == 0x0) break;		(*prog_addr[i])();	}	/*	 * This routine is invoked with a context of system init task.	 * So switching (re-schedule) at here.	 */	tk_exd_tsk();	/*	 *  1: continue to run the system	 *  0: shutdown the system (with power off)	 * -1: re-start the system	 */	return (1);}

⌨️ 快捷键说明

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