串口中断
串口接收字符串.txt
//串口接收以特定字符为开头的字符串并且保存特定字符之后的有效位
#include#defineuintunsignedchar#defineucharunsignedint
ucharser_receive;//串口接收到的数据ucharser_flag=0;
ucharreceive_number[11]={0};//接收串口发送来的数据的数组uchari=0;ucharj;ucharcome=0;voidinit_ser{
tmod=0x20;//定时器1工作在方式2th1=0xfd;tl1=0xfd;//波特率9600tr1=1;ea=1;sm0=0;sm1=1;ren=1;//允许串口接收
es=1;//开串口中断
}
(未完,全文共1208字,当前显示327字)
(请认真阅读下面的提示信息)