⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 downloader.c

📁 代码功能:实现将所要下载的文件写入flash指定的block中
💻 C
字号:
//====================================================================
// File Name : DownLoader.c
// Function  : Use UART to downloader
// Program   : Terminator
// Date      : July 6, 2008
// History
//   0.0  : Programming start (July 6, 2008) ->
//====================================================================
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "def.h"
#include "option.h"
#include "2440addr.h"
#include "2440lib.h"
#include "2440slib.h" 

#include "Nand.h"


void DownLoader(void)
{
	U8 ch;
	U32 number=0,Length,StBlock;
	unsigned char *srcPt=(unsigned char *)0x31100000;
	Uart_Printf("\nAre you ready?I am ready now!\n");
	Uart_Printf("Please input the length of the file which you want to send:");
	
	Length=Uart_GetIntNum();
	number=Length;
	//Get A
	ch=Uart_Getch();
	Uart_Printf("Please Input the start block for flash:\n");
	StBlock=Uart_GetIntNum();
	ch=Uart_Getch();
	
	Uart_Printf("Start DownLoader!!!\n");
	
	while(number--){
		ch=Uart_Getch();
		*srcPt++=ch;
	}

	//srcPt=(unsigned char *)0x31100000;
	Write_Flash(StBlock,Length);
}

⌨️ 快捷键说明

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