📄 uart0_test.c
字号:
/*********************************************************************************************
* File: uart_communication.c
* Author: embest
* Desc: uart test file
* History: wang Fub 16th 2006
*
*********************************************************************************************/
/*------------------------------------------------------------------------------------------*/
/* include files */
/*------------------------------------------------------------------------------------------*/
#include "2410lib.h"
/*********************************************************************************************
* name: uart0_test
* func: uart test function
* para: none
* ret: none
* modify:
* comment:
*********************************************************************************************/
void uart0_test()
{
char cInput[256];
UINT8T ucInNo=0;
char c;
uart_init(0,115200,1);
uart_printf("\n UART0 Communication Test Example\n");
uart_printf(" Please input words, then press Enter:\n");
while(1)
{
c=uart_getch();
uart_printf("%c",c);
if(c!='\r') //enter key
cInput[ucInNo++]=c;
else
{
cInput[ucInNo]='\0';
break;
}
}
delay(1000);
uart_printf("\n The words that you input are: \n %s\n",cInput);
uart_printf(" end.\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -