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

📄 tftpput.c

📁 这是用来测试44BO电路板有关硬件的测试程序
💻 C
字号:
#include "../../inc/config.h"
#include "tftpput.h"
#include "utils.h"

#ifdef	TFTP_DOWNLOAD_SUPPORT

extern char TftpLoadEnd;
extern char TftpPutMark;
extern char TftpPutBegin;
extern unsigned long download_len;
extern unsigned long download_addr;

static unsigned char* buf;
static int data_len;

int tftp_put_begin( void )
{
	buf = ( unsigned char * ) download_addr;
	data_len = 0;
	TftpPutBegin = 1;

	return 0;
}

int tftp_put( unsigned char* data , int len )
{
	static int count = 0;		

	count += len;
	if ( count > 32 * 1024 )
	{
		TftpPutMark = 1;
		count = 0;
	}

	memcpy( buf + data_len , data , len );

	/*	{
			int i;	
			if(len==0x200)
			{
				printf("\n%x:", data_len+0xf0);
				for(i=0xf0; i<0xf4; i++)
					printf("%x,",(buf+data_len)[i]);
			}
		}*/

	data_len += len;			

	return 0;
}

int update_bios( unsigned char* bios , int size )
{
	return 0;
}

int update_system_table( unsigned char* system_table , int size )
{
	return 0;
}

int update_partition_table( unsigned char* partition_table , int size )
{
	return 0;
}

int update_partition( int partition_num , unsigned char* partition_data ,
	int size )
{
	return 0;
}

int update_firmware( unsigned char* firmware , int size )
{
	return 0;
}

int tftp_put_end( void )
{
	TftpLoadEnd = 1;
	download_len = data_len;
	return 0;
}

#endif

⌨️ 快捷键说明

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