www.pudn.com > ARM_Ethernet.rar > target.c, change:2006-01-18,size:6057b


/****************************************Copyright (c)************************************************** 
**                               Guangzou ZLG-MCU Development Co.,LTD. 
**                                      graduate school 
**                                 http://www.zlgmcu.com 
** 
**--------------File Info------------------------------------------------------------------------------- 
** File name:			target.c 
** Last modified Date:	2004-09-17 
** Last Version:		1.0 
** Descriptions:		header file of the specific codes for LPC2200 target boards 
**				Every project should include a copy of this file, user may modify it as needed 
**------------------------------------------------------------------------------------------------------ 
** Created by:			Chenmingji 
** Created date:		2004-02-02 
** Version:				1.0 
** Descriptions:		The original version 
** 
**------------------------------------------------------------------------------------------------------ 
** Modified by:			Chenmingji 
** Modified date:		2004-09-17 
** Version:				1.01 
** Descriptions:		Renewed the template, added more compiler supports  
** 
**------------------------------------------------------------------------------------------------------ 
** Modified by:         Ganda 
** Modified date:       2005-06-15 
** Version:			    1.02 
** Descriptions:        Added code for copying vector 
** 
**------------------------------------------------------------------------------------------------------ 
** Modified by:  
** Modified date: 
** Version:	 
** Descriptions:  
** 
********************************************************************************************************/ 
 
#define IN_TARGET 
#include "config.h" 
#include <stdlib.h> 
 
#pragma import(__use_no_semihosting_swi) 
#pragma import(__use_two_region_memory) 
 
#if OS_TASK_STAT_EN > 0 
const unsigned int LowPRI = OS_LOWEST_PRIO - 2; 
#else 
const unsigned int LowPRI = OS_LOWEST_PRIO - 1; 
#endif 
 
static const uint8 MyIp[] = MY_IP_1ID; 
static const uint8 MyMark[] = IP_MARK_1ID; 
static const uint8 MyGateWay[] = MY_GATEWAY_1ID; 
 
/********************************************************************************************************* 
** Function name:			TargetInit 
** 
** Descriptions:			Initialize the target board before running the main() function; User may 
**							change it as needed, but may not deleted it. 
** 
** input parameters:		None 
** Returned value:			None 
**          
** Used global variables:	None 
** Calling modules:			None 
** 
** Created by:				Chenmingji 
** Created Date:			2004/02/02 
**------------------------------------------------------------------------------------------------------- 
** Modified by:             Ganda 
** Modified date:           2005/06/15 
**------------------------------------------------------------------------------------------------------ 
** Modified by: 
** Modified date: 
**------------------------------------------------------------------------------------------------------ 
********************************************************************************************************/ 
        void TargetInit(void) 
{ 
    //extern void Uart0ISR(void);     
 
    SysInit(); 
    ZlgipInitial(MyIp, MyGateWay, MyMark); 
    /* 添加自己的初始化代码 */ 
    /* Add your codes here */ 
     
    //SetISRFuction(IRQ_UART0, 4, (void *)Uart0ISR); 
} 
 
/********************************************************************************************************* 
**                  以下为一些与系统相关的库函数的实现 
**                  具体作用请ads的参考编译器与库函数手册 
**                  用户可以根据自己的要求修改         
********************************************************************************************************/ 
/********************************************************************************************************* 
**                  The implementations for some library functions 
**                  For more details, please refer to the ADS compiler handbook and The library  
**					function manual 
**                  User could change it as needed        
********************************************************************************************************/ 
 
#include "rt_sys.h" 
#include "stdio.h" 
 
#pragma import(__use_no_semihosting_swi) 
#pragma import(__use_two_region_memory) 
 
#if 0 
        int __rt_div0(int a) 
{ 
    a = a; 
    return 0; 
} 
 
        int fputc(int ch,FILE *f) 
{ 
    ch = ch; 
    f = f; 
    return 0; 
} 
 
    int fgetc(FILE *f) 
{ 
    f = f; 
    return 0; 
} 
 
 
        int _sys_close(FILEHANDLE fh) 
{ 
    fh = fh; 
    return 0; 
} 
 
        int _sys_write(FILEHANDLE fh, const unsigned char * buf, 
                      unsigned len, int mode) 
{ 
    fh = fh; 
    buf = buf; 
    len =len; 
    mode = mode; 
    return 0; 
} 
        int _sys_read(FILEHANDLE fh, unsigned char * buf, 
                     unsigned len, int mode) 
{ 
    fh = fh; 
    buf = buf; 
    len =len; 
    mode = mode; 
     
    return 0; 
} 
#endif 
       void _ttywrch(int ch) 
{ 
    ch = ch; 
} 
 
#if 0 
        int _sys_istty(FILEHANDLE fh) 
{ 
    fh = fh; 
    return 0; 
} 
        int _sys_seek(FILEHANDLE fh, long pos) 
{ 
    fh = fh; 
    pos = pos; 
    return 0; 
} 
        int _sys_ensure(FILEHANDLE fh) 
{ 
    fh = fh; 
    return 0; 
} 
 
        long _sys_flen(FILEHANDLE fh) 
{ 
    fh = fh; 
    return 0; 
} 
       int _sys_tmpnam(char * name, int sig, unsigned maxlen) 
{ 
    name = name; 
    sig = sig; 
    maxlen = maxlen; 
    return 0; 
} 
 
 
        void _sys_exit(int returncode) 
{ 
    returncode = returncode; 
} 
 
        char *_sys_command_string(char * cmd, int len) 
{ 
    cmd = cmd; 
    len = len; 
    return 0; 
} 
#endif 
 
/********************************************************************************************************* 
**                            End Of File 
********************************************************************************************************/