From 48b7027c5628e62f09eb23e705cd94bca50aca6f Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Wed, 15 Jul 2026 10:51:27 +0800 Subject: [PATCH] =?UTF-8?q?spoolend=5Fnew=20=E3=80=90=E7=96=91=E9=9A=BE?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3=E8=AE=B0=E5=BD=95=E3=80=91?= =?UTF-8?q?=E4=B8=B2=E5=8F=A3=E5=9B=9E=E6=98=BE=E7=9B=B4=E6=8E=A5=E5=9C=A8?= =?UTF-8?q?read=E5=90=8E=E8=B0=83=E7=94=A8=EF=BC=8C=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=8C=89=E5=B8=A7=E7=9A=84=E6=95=B0=E6=8D=AE=E6=97=B6=E6=89=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=9C=A8=E5=9B=9E=E8=B0=83=E4=B8=AD=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/Spoolend/Spoolend.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/project/Spoolend/Spoolend.c b/project/Spoolend/Spoolend.c index 6c4086a..a90e303 100644 --- a/project/Spoolend/Spoolend.c +++ b/project/Spoolend/Spoolend.c @@ -104,12 +104,12 @@ static int check_Spoolend(char *_pBuffer, uint32_t _iSize) static void decode_RS485_1(const char *_pBuffer, uint32_t _iSize) { - rd_ComWrite(g_ptRS485_1, (char *)_pBuffer, _iSize); + //rd_ComWrite(g_ptRS485_1, (char *)_pBuffer, _iSize); } static void decode_RS485_2(const char *_pBuffer, uint32_t _iSize) { - rd_ComWrite(g_ptRS485_2, (char *)_pBuffer, _iSize); + //rd_ComWrite(g_ptRS485_2, (char *)_pBuffer, _iSize); } static void decode_Spoolend(const char *_pBuffer, uint32_t _iSize) @@ -187,13 +187,13 @@ void SpoolendTask(void) char pcBuffer2[52] = {0}; char pcBuffer3[52] = {0}; __disable_irq(); - rd_ComRead(g_ptRS485_1, pcBuffer1, sizeof(pcBuffer1)); - rd_ComRead(g_ptRS485_2, pcBuffer2, sizeof(pcBuffer2)); + int i485_1 = rd_ComRead(g_ptRS485_1, pcBuffer1, sizeof(pcBuffer1)); + int i485_2 = rd_ComRead(g_ptRS485_2, pcBuffer2, sizeof(pcBuffer2)); rd_ComRead(g_ptFDCAN1, pcBuffer3, sizeof(pcBuffer3)); __enable_irq(); -// rd_ComWrite(g_ptRS485_1, "Hello\n", 6); -// rd_ComWrite(g_ptRS485_2, "Hello\n", 6); + if (i485_1 > 0) rd_ComWrite(g_ptRS485_1, pcBuffer1, i485_1); + if (i485_2 > 0) rd_ComWrite(g_ptRS485_2, pcBuffer2, i485_2); // rd_ComIDWrite(g_ptFDCAN1, 1, "Hello\n", 6); HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin); @@ -208,6 +208,5 @@ void SpoolendTask(void) rd_ComSendProc(g_ptRS485_1); rd_ComSendProc(g_ptRS485_2); rd_ComSendProc(g_ptFDCAN1); - HAL_Delay(10); }