From 8587c5cbb40fd60b37d762dfafa8fef683eb4fea Mon Sep 17 00:00:00 2001
From: QuakeGod <QuakeGod@sina.com>
Date: 星期一, 17 十月 2022 02:53:49 +0800
Subject: [PATCH] fix some utf-8 to GBK

---
 Src/ModbusRTU.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Src/ModbusRTU.c b/Src/ModbusRTU.c
index ad0b02f..bd939f3 100644
--- a/Src/ModbusRTU.c
+++ b/Src/ModbusRTU.c
@@ -86,12 +86,12 @@
 
 int ModBusSlaveCheckPkg(int nChn, void *ptr, uint16_t len1)
 {
-	if (len1 <=4) return -1;		//锟斤拷锟斤拷
+	if (len1 <=4) return -1;		//包长
 	pModBusRTUReqPkg pPkg = (pModBusRTUReqPkg) ptr;
-	if (pPkg->Dst >127) return -2;   //锟斤拷址锟斤拷
-	if ((pPkg->Cmd&0x7f) > 0x1f) return -3;  //锟斤拷锟斤拷锟斤拷
-	uint16_t crc = crc16tablefast(ptr,len1);   //CRC 校锟斤拷
-	if (crc != 0 ) return 4;		//CRC 校锟斤拷锟斤拷锟�
+	if (pPkg->Dst >127) return -2;   //地址码
+	if ((pPkg->Cmd&0x7f) > 0x1f) return -3;  //功能码
+	uint16_t crc = crc16tablefast(ptr,len1);   //CRC 校验
+	if (crc != 0 ) return 4;		//CRC 校验错误
 	return S_OK;
 }
 

--
Gitblit v1.9.1