main.c

来自「嵌入式S3C44BOX平台通过串口线实现与PC超级端口之间的串行通信。」· C语言 代码 · 共 31 行

C
31
字号
#include"uhal.h"
#include"def.h"
#include"myuart.h"
#pragma import(__use_no_semihosting_swi)  // ensure no functions that use semihosting 
int main(void)
{
	char c1[1];
	char temp[1000];
	unsigned int i,j=0;
	char err;
	ARMTargetInit();	//开发版初始化

	Uart_Printf("input your word(end with #):\n");
    //Uart_SendByte(0,0xa);//换行
	//Uart_SendByte(0,0xd);//回车
	
	while(c1[0]!='#')
	{
       	//Uart_SendByte(0,0xa);//换行
		//Uart_SendByte(0,0xd);//回车
        	err=Uart_Getch(c1,0,0);	//从串口采集数据
        	//Uart_SendByte(0,c1[0]);	//显示采集的数据
        	temp[j++]=c1[0];
	}
	Uart_Printf("ok\n");
	for(i=0;i<j;i++)
	{
		Uart_SendByte(0,temp[i]);
	}
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?