From 93e48fc389d52fa414ea79d02315ede8bc64e853 Mon Sep 17 00:00:00 2001 From: 95384 <664090429@qq.com> Date: Fri, 13 Dec 2024 13:49:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=20=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=84=E5=AD=98=E5=99=A8=E7=9B=B8=E5=BA=94=E5=B8=A7=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Src/frt_protocol.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/App/Src/frt_protocol.c b/App/Src/frt_protocol.c index 3dea295..3818e81 100644 --- a/App/Src/frt_protocol.c +++ b/App/Src/frt_protocol.c @@ -1271,16 +1271,18 @@ void FRT_MsgProc_WriteRegister(device_handle device, void *pMsg) // } // 发回数据 - uint8_t Trans_data[6]; + uint8_t Trans_data[8]; Trans_data[0] = g_usrConfigInfo.addr; Trans_data[1] = data[1]; - Trans_data[2] = start_reg_addr; - Trans_data[3] = reg_num; + Trans_data[2] = start_reg_addr >> 8; + Trans_data[3] = start_reg_addr; + Trans_data[4] = reg_num >> 8; + Trans_data[5] = reg_num; - return_crc_value = CRC16(Trans_data, 4); - Trans_data[4] = return_crc_value; - Trans_data[5] = return_crc_value >> 8; - uart_dev_write(device, Trans_data, 6); + return_crc_value = CRC16(Trans_data, 6); + Trans_data[6] = return_crc_value; + Trans_data[7] = return_crc_value >> 8; + uart_dev_write(device, Trans_data, 8); for(u_int16_t pos=0; pos