📄 main.c
字号:
/**************************************************************************
Copyright (c) 2007, Dmatek Development Kit Department All rights reserved
FileName : Main.c
Description: main function, System initialization and Uart test
Version : 1.0
Author : Dmatek_Chen
Date : June 23, 2007
***************************************************************************/
#include <stdlib.h>
#include <string.h>
#include "def.h"
#include "option.h"
#include "2440addr.h"
#include "2440lib.h"
#include "2440slib.h"
void Main(void)
{
int data;
Port_Init();
Uart_Init( 0,115200 );
Uart_Select(1 );
Uart_Printf("test uart \n");
Uart_Printf("Please input some letter or number\r\n");
while(1)
{
while((rUTRSTAT1 & 0x1)==0x0);
data = rURXH1;
if(data=='\r')
{
while(!(rUTRSTAT1 & 0x2));
rUTXH1 = data;
while(!(rUTRSTAT1 & 0x2));
rUTXH1 = '\n';
}
else
{
while(!(rUTRSTAT1 & 0x2));
rUTXH1 = data;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -