main.c

来自「在阳初s3c2410上实现的uudecode协议」· C语言 代码 · 共 46 行

C
46
字号
#include "config.h"
#include "uart.h"
#include "utils.h"
#include "xmodem.h"
#include "uudecode.h"

int main() 
{
	int i;
	long* p;
	char* src  = (char*)SDRAM_BASE;

	/* initialize UART */
	init_uart();
	sio_puts("\n------"__DATE__ "    " __TIME__ "------\n");
	sio_puts("\nSuccess to initialize Serial , please send your file...\n");

	/* receive data */
	sio_puts("File receiving...");
	if (xmodem_recv(src) >= 0) {
		sio_puts("...Receive success!\n");
	} else {
		sio_puts("...Receive fail!\n");
		return -1;
	}

	/* decode data */
	sio_puts("File decoding...");
	if(uudecode(src, src) >= 0) {
		sio_puts("...Decode success!\n");
	} else {
		sio_puts("...Decode fail!\n");
		return -2;
	}

	sio_puts("Jump to SDRAM base address (0x30000000)\nProgram excecuting...\n\n");

	/* delay one second for serial */
	delay(ONE_SEC);

	/* jump to SDRAM_BASE address (0x30000000) */
	((void(*)())SDRAM_BASE)();

	return 0;
}

⌨️ 快捷键说明

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