/*------------------------------------------------------------------------------------------*/ /* include files */ /*------------------------------------------------------------------------------------------*/ #include "..\common\inc\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,0); 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"); }