From b9513e52910526849f9aa44be61016e90a2c9c93 Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Fri, 4 Sep 2026 13:35:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=B2=E5=8F=A3=E6=9C=AA?= =?UTF-8?q?=E7=9F=A5=E6=95=B0=E6=8D=AE=E6=85=A2=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9A=E9=94=99=E8=AF=AF=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=BA1.5=E7=A7=92=EF=BC=9B=E4=B8=B2?= =?UTF-8?q?=E5=8F=A3=E8=AF=BB=E5=8F=96=E7=BA=BF=E7=A8=8B=E5=BB=B6=E6=97=B6?= =?UTF-8?q?=E5=8F=96=E6=B6=88=EF=BC=9Bcrc=E6=A0=A1=E9=AA=8C=E4=B8=8D?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E6=97=B6=E7=AD=89=E5=BE=85=EF=BC=8C=E9=9D=A0?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E9=80=BB=E8=BE=91=E5=85=9C=E5=BA=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RBcore/client_setting.c | 3 +-- RBcore/drv_interface.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/RBcore/client_setting.c b/RBcore/client_setting.c index 48b8740..170f1e1 100644 --- a/RBcore/client_setting.c +++ b/RBcore/client_setting.c @@ -51,7 +51,6 @@ static PV_struct_define decoded_PV = { 0 }; *----------------------------------------------*/ int check_PV(char *_pBuffer, uint32_t _iSize) { - if (_iSize < 4) return -1; if (_pBuffer[0] != 0x55) return -1; if (_pBuffer[1] != 0x55) return -1; @@ -63,7 +62,7 @@ int check_PV(char *_pBuffer, uint32_t _iSize) } else { - return -1; + return 0; } } diff --git a/RBcore/drv_interface.c b/RBcore/drv_interface.c index 1577cbe..af47fed 100644 --- a/RBcore/drv_interface.c +++ b/RBcore/drv_interface.c @@ -241,7 +241,6 @@ void Read_PV(void *argument) while(1) { rd_ComRead(g_ptlpuart, pcBuffer, 64); - Rd_Delay(10); } } @@ -291,6 +290,7 @@ void Drv_InterfaceInit(void) TUartUserData *ptUartUserData = UART_userdata_init(0, -1, 512); g_ptlpuart = rd_ComCreate(check_PV, decode_PV, LPUART_PV_Send, ptUartUserData->m_buf_size, ptUartUserData); UART_IT_init(g_ptlpuart); + rd_ComSetRecvTime(g_ptlpuart, 1500);// PV平均一到两秒发一条,这里超时时间设置为1.5秒 const osThreadAttr_t Read_PV_attributes = { .name = "Read_PV",