forked from gatsby/df_datalink
fix: 修改UART上传帧长, 修改节点配置主节点ID识别
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
* @name SystemMonitor_Constants
|
* @name SystemMonitor_Constants
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define PAYLOAD_LEN_MAX 2048
|
#define PAYLOAD_LEN_MAX 1000
|
||||||
|
|
||||||
#define DATA_ID_NONE UINT32_MAX
|
#define DATA_ID_NONE UINT32_MAX
|
||||||
#define DATA_ID_TEST 0x02030203
|
#define DATA_ID_TEST 0x02030203
|
||||||
@@ -232,7 +232,7 @@ typedef struct
|
|||||||
uint32_t dataId; ///< data identifier
|
uint32_t dataId; ///< data identifier
|
||||||
uint8_t nodeId; ///< destination ID for tx, source ID for rx
|
uint8_t nodeId; ///< destination ID for tx, source ID for rx
|
||||||
uint16_t dataLen; ///< data length
|
uint16_t dataLen; ///< data length
|
||||||
uint8_t data[PAYLOAD_LEN_MAX];
|
uint8_t data[1000];
|
||||||
} SYSMON_SVC_PAYLOAD;
|
} SYSMON_SVC_PAYLOAD;
|
||||||
|
|
||||||
/************************** Function Prototypes ******************************/
|
/************************** Function Prototypes ******************************/
|
||||||
|
|||||||
@@ -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)
|
if (msg[WD_ID_CMD] >= 0 && msg[WD_ID_CMD] < linkConfig.netScale)
|
||||||
{
|
{
|
||||||
reconfig |= (msg[WD_ID_CMD] != linkConfig.myId);
|
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];
|
linkConfig.myId = msg[WD_ID_CMD];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -399,7 +399,7 @@ int32_t SystemBus_GenRecvRsp(SYSBUS *instPtr, SYSMON_SVC_PAYLOAD *payload)
|
|||||||
ASSERT(instPtr != NULL);
|
ASSERT(instPtr != NULL);
|
||||||
ASSERT(payload != 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)
|
if (sysbusRsp == NULL)
|
||||||
{
|
{
|
||||||
DBG_ERROR("Failed to allocate memory for Receive Response!\n");
|
DBG_ERROR("Failed to allocate memory for Receive Response!\n");
|
||||||
|
|||||||
@@ -119,4 +119,4 @@ bool SysbusUart_IsTxBusy(SYSBUS_UART *instPtr);
|
|||||||
|
|
||||||
/** @} SystemBus_UART*/
|
/** @} SystemBus_UART*/
|
||||||
|
|
||||||
/** @} SystemBus*/
|
/** @} SystemBus*/
|
||||||
|
|||||||
Reference in New Issue
Block a user