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

📄 main.c

📁 在板上实现USB下载代码,速度非常快.对代码的更新很有用.
💻 C
字号:
#include <string.h>
#include ".\Target\option.h"
#include ".\Target\def.h"
#include ".\Target\44b.h"
#include ".\Target\44blib.h"
#include ".\usb\usbdrv.h"
#include ".\usb\Usb_reg.h"

#include <stdio.h>
/********************************************/
//   ARMSYS实验十四:USB接口应用实验 
//   描述:从USB接口接收自PC机发送的文本文件                    
/********************************************/
void (*runinram)(void)=(void (*)(void))RAM_ADDRESS;
extern byte USBN9604_init(void);
byte code_loaded=0;

int Main(void)
{
	int i,j;
	int time = 100000 * 60;
    char aa;
	rSYSCFG=CACHECFG;	// Using 8KB Cache//
	Port_Init();
	Uart_Init(0,115200);
	Beep(0x01);
	Led_Display(0xf);
	Delay(0);

	Uart_Select(0); //Select UART0//
	Uart_Printf("\n*************************************************************************");
	Beep(0x00);
	Uart_Printf("\n*                           立宇泰电子                                  *");
	Uart_Printf("\n*                      -USB Test Program-                               *");
	Uart_Printf("\n*                          Version 1.21                                 *");
	Uart_Printf("\n*                Email:Support@hzlitai.com.cn                           *");
	Uart_Printf("\n*             UART Config--COM:115.2kbps,8Bit,NP,UART0                  *");

	Led_Display(0x0);
	Uart_Printf("\n*----------------Begin test USB? (Y/N)----------------------------------*");
	Led_Display(0x0);

	aa= Uart_Getch();
	if((aa=='Y')||(aa=='y'))
	{
		if(USBN9604_init())
	    {
	        Uart_Printf("\nThe USB chip is not stable or reset failed.");
			return 1;
		}
		else
		Uart_Printf("\nThe USB chip is now active!");	
	}
	else
		Uart_Printf("\nUSB is inactive!");
	rINTCON=0x5;//fiq disable
	
	while(1);
	
	return 0;
}

⌨️ 快捷键说明

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