单片机串口接收数据到缓存区,从缓存区中发送出去,设缓存区的大小为40字节,为什么我的程序有问题呀,请教高手: while(1) { if(RI==1) { c=SBUF; if(Comm_GetcharCtr<MAX_BYTE_IO)//缓冲区里的字符个数小与发送最大值 { *pWriteByteBuffer=c; pWriteByteBuffer++; //缓冲区指针 Comm_GetcharCtr++; //字符计数值 if(pWriteByteBuffer==&mCmdParam.ByteWrite.mByteBuffer[MAX_BYTE_IO]) { pWriteByteBuffer==&mCmdParam.ByteWrite.mByteBuffer[0]; mCmdParam.ByteWrite.mByteCount = MAX_BYTE_IO; i = CH375ByteWrite( ); mStopIfError( i ); } } } RI=0; if(c == 0) break; /* 源字符串结束,完成写文件 */ } mCmdParam.ByteWrite.mByteCount =Comm_GetcharCtr; i = CH375ByteWrite( ); mStopIfError( i ); |