2019-07-21 00:39发布
余怡帆℡ 发表于 2019-5-28 17:29 [mw_shl_code=c,true]void Uart2Process(void) { u8 buff[512]; /*Need Modify*/
最多设置5个标签!
{
u8 buff[512]; /*Need Modify*/
int buffLen = 0;
int frameLen = 0;
int i;
buffLen = UART_Read(DEV_UART2, &buff[frameLen], sizeof(buff));
//printf("zzzzzzzzzzzzz");
if(buffLen != 0)
{
frameLen += buffLen;
if( frameLen > sizeof( buff ))
{
buffLen = 0;
frameLen = 0;
printf("VVVVVVVVVVVVVV");
}
for(i = 0;i < frameLen;i++)
{
if((buff== FRAME_COMM_START) && (buff[i+8] == FRAME_COMM_START))
{
if(0 != appCommRevDataCheck(&buff,frameLen-i))
{
printf("QQQQQQQQQQQQ");
continue;
}
else
{
appCommRevDataDeal(buff[1],&buff,frameLen-i);
buffLen = 0;
frameLen = 0;
}
}
}
}[/mw_shl_code]
改成这样解析不报错了,但是还是会卡顿,就是收几条才会有应答
一周热门 更多>