📄 main.c
字号:
/****************************************************************************
【文 件 名 称】main.c
【功 能 描 述】三星S3C44B0X板demo程序代码
【程 序 版 本】4.0
【创建人及创建日期】龚俊//2002年11月19日19:26
【修改人及修改日期】龚俊//2004-12-8 17:25
****************************************************************************/
//***************************************************************************
#include "def.h"
#include "44b.h"
#include "44blib.h"
#include "eth.h"
#include "arp.h"
extern void tftp_main(U32 addr, U32 give_ip) ;
U32 download_len ;
U32 download_addr ;
//***************************************************************************
/****************************************************************************
【功能说明】系统主函数
****************************************************************************/
void Main(void)
{
rNCACHBE0 = ((Non_Cache_End>>12)<<16)|(Non_Cache_Start>>12);
//在上面的数据区域不使用高速缓存
Port_Init(); //IO口初始化
Uart_Select( 0 ) ; //选择串口0
Uart_Init( 0, 115200 ) ;
//串口初始化,波特率为115200(系统主频为32MHz)
Uart_Printf( "\n\n\tS3C44B0X tftp TEST !\n\n" ) ;
#define DOWNLOAD_ADDR 0xc008000
#define IP_ADDRESS ((192U<<24)|(168<<16)|(3<<8)|100)
//默认IP为192.168.3.100
Uart_Printf("Now download file from net to 0x%x...\n", DOWNLOAD_ADDR);
tftp_main( DOWNLOAD_ADDR, IP_ADDRESS ) ;
if ( download_len == -1 )
Uart_Printf("Tftp Download Aborted!\n");
else
Uart_Printf("\nReceived %x bytes success\n", download_len);
while( 1 ) ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -