From 16eeda8e1e205da3395f6933f6f82b22da63c76b Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期六, 28 一月 2023 15:41:25 +0800 Subject: [PATCH] Radio add channel jumpper config --- Src/ModbusRTU.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Src/ModbusRTU.c b/Src/ModbusRTU.c index bd939f3..154b21c 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