*bugfix: avoid unnecessary reconfiguration

This commit is contained in:
Gatsby Van
2024-01-31 10:17:43 +08:00
parent 3916b18a6f
commit 085e5cea93
+4 -2
View File
@@ -349,14 +349,16 @@ int32_t SystemBus_HandleCmd(SYSBUS *instPtr)
PHY_INST *phyRef = linkInstPtr->config.phyInstPtr; PHY_INST *phyRef = linkInstPtr->config.phyInstPtr;
TMC_INST *tmcRef = linkInstPtr->config.tmcInstPtr; TMC_INST *tmcRef = linkInstPtr->config.tmcInstPtr;
if (data[WD_MODE_CMD] == MODE_CMD_HEAD) if (data[WD_MODE_CMD] == MODE_CMD_HEAD
&& L2_GetNodeType(linkInstPtr) != L2_NODE_HEAD)
{ {
// head node config // head node config
linkConfig.myType = L2_NODE_HEAD; linkConfig.myType = L2_NODE_HEAD;
linkConfig.myId = 1; linkConfig.myId = 1;
Linklayer_Reconfig(linkInstPtr, &linkConfig); Linklayer_Reconfig(linkInstPtr, &linkConfig);
} }
else if (data[WD_MODE_CMD] == MODE_CMD_MEMBER) else if (data[WD_MODE_CMD] == MODE_CMD_MEMBER
&& L2_GetNodeType(linkInstPtr) != L2_NODE_MEMBER)
{ {
// member node config // member node config
linkConfig.myType = L2_NODE_MEMBER; linkConfig.myType = L2_NODE_MEMBER;