From 6b9a2c8cc48aef92b7b9df80360762b5884bd93d Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Tue, 24 Jun 2025 10:02:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9UART=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=B8=A7=E9=95=BF,=20=E4=BF=AE=E6=94=B9=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=BB=E8=8A=82=E7=82=B9ID=E8=AF=86?= =?UTF-8?q?=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/system_monitor.h | 4 ++-- src/systembus/systembus.c | 4 ++-- src/systembus/systembus_uart.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/system_monitor.h b/src/system_monitor.h index 82fe857..8d93188 100644 --- a/src/system_monitor.h +++ b/src/system_monitor.h @@ -16,7 +16,7 @@ * @name SystemMonitor_Constants * @{ */ -#define PAYLOAD_LEN_MAX 2048 +#define PAYLOAD_LEN_MAX 1000 #define DATA_ID_NONE UINT32_MAX #define DATA_ID_TEST 0x02030203 @@ -232,7 +232,7 @@ typedef struct uint32_t dataId; ///< data identifier uint8_t nodeId; ///< destination ID for tx, source ID for rx uint16_t dataLen; ///< data length - uint8_t data[PAYLOAD_LEN_MAX]; + uint8_t data[1000]; } SYSMON_SVC_PAYLOAD; /************************** Function Prototypes ******************************/ diff --git a/src/systembus/systembus.c b/src/systembus/systembus.c index 649d7a0..87bc8cc 100644 --- a/src/systembus/systembus.c +++ b/src/systembus/systembus.c @@ -237,7 +237,7 @@ static int32_t SystemBus_SystemConfig(SYSBUS *instPtr, uint8_t *msg) if (msg[WD_ID_CMD] >= 0 && msg[WD_ID_CMD] < linkConfig.netScale) { reconfig |= (msg[WD_ID_CMD] != linkConfig.myId); - linkConfig.myType = (msg[WD_ID_CMD] == 0) ? L2_NODE_HEAD : L2_NODE_MEMBER; + linkConfig.myType = (msg[WD_ID_CMD] == L2_HEAD_ID) ? L2_NODE_HEAD : L2_NODE_MEMBER; linkConfig.myId = msg[WD_ID_CMD]; } else @@ -399,7 +399,7 @@ int32_t SystemBus_GenRecvRsp(SYSBUS *instPtr, SYSMON_SVC_PAYLOAD *payload) ASSERT(instPtr != NULL); ASSERT(payload != NULL); - SYSBUS_UART_FRAME *sysbusRsp = malloc(sizeof(SYSBUS_UART_FRAME)); + SYSBUS_UART_FRAME *sysbusRsp = malloc(NORMALIZE_SIZE(sizeof(SYSBUS_UART_FRAME))); if (sysbusRsp == NULL) { DBG_ERROR("Failed to allocate memory for Receive Response!\n"); diff --git a/src/systembus/systembus_uart.h b/src/systembus/systembus_uart.h index b5105de..632a839 100644 --- a/src/systembus/systembus_uart.h +++ b/src/systembus/systembus_uart.h @@ -119,4 +119,4 @@ bool SysbusUart_IsTxBusy(SYSBUS_UART *instPtr); /** @} SystemBus_UART*/ -/** @} SystemBus*/ \ No newline at end of file +/** @} SystemBus*/