?? flash.c
字號(hào):
//====================================================================
// File Name : flash.c
// Function : S3C2440 Flash Program
// Program : Kong, In Wook (KIW)
// Date : May 30, 2002
// Version : 0.0
// History
// 0.0 : Programming start (May 30,2002) -> KIW
// Arrangement source code(8/01/2002)-> SOP
// Edited for SMDK2440(07/07/2003) -> Junon
//====================================================================
#include <string.h>
#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"
#include "mmu.h"
#include "strata32.h"
#include "xmodem.h"
static int DownloadData(void);
U32 downloadAddress;
U32 downloadProgramSize = 0;
//==========================================================================================
void ProgramFlash(void)
{
char key;
Uart_Printf("\n[2410D 燒寫Intel Flash ]");
Uart_Printf("\nThe program buffer : 0x31000000 ~ 0x31ffffff");
Uart_Printf("\n按任意鍵繼續(xù)!");
while(!Uart_Getch());
downloadAddress=0x31000000;
downloadProgramSize=0x0;
Uart_Printf("Do you want to download through UART0 from 0x%x? [y/n] : ", downloadAddress);
key = Uart_Getch();
Uart_Printf("%c\n",key);
if(key=='y')
{
if(!DownloadData())
return;
}
Program28F128J3A();
}
static int DownloadData(void)
{
char *pBuf = (char*)downloadAddress;
size_t sizeBuf = 1024*1024*4;
unsigned long nDownloadSize;
Uart_Printf("\n請(qǐng)使用超級(jí)終端(XMODEM)發(fā)送文件。");
Uart_Printf("\n開始下載...");
nDownloadSize = xmodem_receive(pBuf, sizeBuf);
if(nDownloadSize > 0)
{
downloadProgramSize = (U32)nDownloadSize;
Uart_Printf("\n下載完成。");
return 1;
}
else
{
downloadProgramSize = 0;
Uart_Printf("\n下載失敗。");
return 0;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -