-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuart_test.c
48 lines (46 loc) · 1.42 KB
/
uart_test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*********************************************************************************************
* File£º uart_test.c
* Author: embest
* Desc£º UART_Test
* History:
*********************************************************************************************/
/*------------------------------------------------------------------------------------------*/
/* include files */
/*------------------------------------------------------------------------------------------*/
#include "uart_test.h"
extern char *string;
/*********************************************************************************************
* name: uart1_test
* func: uart test function
* para: none
* ret: none
* modify:
* comment:
*********************************************************************************************/
void uart1_test(void)
{
char cInput[256];
UINT8T ucInNo=0;
UINT32T g_nKeyPress;
char c;
uart_printf(" Please input words, then press Enter:\n");
uart_printf(" />");
uart_printf(" ");
g_nKeyPress = 1;
while(g_nKeyPress==1) // only for board test to exit
{
c=uart_getch();
uart_printf("%c",c);
if(c!='\r')
cInput[ucInNo++]=c;
else
{
cInput[ucInNo]='\0';
break;
}
}
delay(1000);
string = cInput;
uart_printf("\n The words that you input are: %s\n",cInput);
uart_printf(" End.\n");
}