forked from gatsby/df_datalink
*bugfix: avoid unnecessary reconfiguration
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user