omit unnecessary reconfiguration
This commit is contained in:
@@ -378,21 +378,28 @@ int32_t SystemBus_HandleCmd(SYSBUS *instPtr)
|
||||
PHY_INST *phyRef = linkInstPtr->config.phyInstPtr;
|
||||
TMC_INST *tmcRef = linkInstPtr->config.tmcInstPtr;
|
||||
|
||||
if (data[WD_MODE_CMD] == MODE_CMD_HEAD
|
||||
&& L2_GetNodeType(linkInstPtr) != L2_NODE_HEAD)
|
||||
if (data[WD_MODE_CMD] == MODE_CMD_HEAD)
|
||||
{
|
||||
// head node config
|
||||
linkConfig.myType = L2_NODE_HEAD;
|
||||
linkConfig.myId = 1;
|
||||
Linklayer_Reconfig(linkInstPtr, &linkConfig);
|
||||
// omit unnecessary reconfiguration
|
||||
if (L2_GetNodeType(linkInstPtr) != L2_NODE_HEAD)
|
||||
{
|
||||
// head node config
|
||||
linkConfig.myType = L2_NODE_HEAD;
|
||||
linkConfig.myId = 1;
|
||||
Linklayer_Reconfig(linkInstPtr, &linkConfig);
|
||||
}
|
||||
}
|
||||
else if (data[WD_MODE_CMD] == MODE_CMD_MEMBER
|
||||
&& L2_GetNodeType(linkInstPtr) != L2_NODE_MEMBER)
|
||||
|
||||
else if (data[WD_MODE_CMD] == MODE_CMD_MEMBER )
|
||||
{
|
||||
// member node config
|
||||
linkConfig.myType = L2_NODE_MEMBER;
|
||||
linkConfig.myId = 2;
|
||||
Linklayer_Reconfig(linkInstPtr, &linkConfig);
|
||||
// omit unnecessary reconfiguration
|
||||
if (L2_GetNodeType(linkInstPtr) != L2_NODE_MEMBER)
|
||||
{
|
||||
// member node config
|
||||
linkConfig.myType = L2_NODE_MEMBER;
|
||||
linkConfig.myId = 2;
|
||||
Linklayer_Reconfig(linkInstPtr, &linkConfig);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user