main.c

来自「杭州利宇泰公司的基于44B0的ARMSys开发板上的大量源代码」· C语言 代码 · 共 62 行

C
62
字号
#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.11                                 *");
	Uart_Printf("\n*                Email:rao_dali@263.net                                 *");
	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 + =
减小字号Ctrl + -
显示快捷键?