Commit b92ecf5b authored by 李冠华's avatar 李冠华

🐞 fix:修改由于接收到的不完整数据过多导致读取485数据长度剩余空间为0,引起检测台停止接收数据的问题

parent 2f2ae5f4
...@@ -67,6 +67,10 @@ void RS485_Protocol_Service(void) ...@@ -67,6 +67,10 @@ void RS485_Protocol_Service(void)
if ( UARTRead_Cbk != Protocol_NULL ) if ( UARTRead_Cbk != Protocol_NULL )
{ {
if(mDataBufLen >= 200U)
{
mDataBufLen = 0U;
}
readNum = UARTRead_Cbk(mDataBufPtr + mDataBufLen, 256 - mDataBufLen); readNum = UARTRead_Cbk(mDataBufPtr + mDataBufLen, 256 - mDataBufLen);
if ( readNum > 0 ) if ( readNum > 0 )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment