code simplify

This commit is contained in:
Gatsby Van
2024-01-31 10:18:40 +08:00
parent 678bb7f393
commit f4175cd7b5
+3 -4
View File
@@ -380,18 +380,16 @@ int32_t SystemBus_HandleCmd(SYSBUS *instPtr)
{
// high power config
Phy_AntConfigMode(phyRef, PHY_ANT_MODE_HIGH_POWER);
Linklayer_Start(linkInstPtr);
}
else if(data[WD_EN_CMD] == EN_CMD_ON_LOW_POWER)
{
// low power config
Phy_AntConfigMode(phyRef, PHY_ANT_MODE_LOW_POWER);
Linklayer_Start(linkInstPtr);
}
else
{
// silence config
// FIXME: confirm
// TODO: better approach?
Linklayer_Halt(linkInstPtr);
Phy_AntConfigMode(phyRef, PHY_ANT_MODE_SILENT);
@@ -403,9 +401,10 @@ int32_t SystemBus_HandleCmd(SYSBUS *instPtr)
DBG_ERROR("Physical set pull time failed, with error code: %" PRId32 ".\n", Status);
}
Phy_SetupNextSlot(phyRef, PHY_TOR_RX, L1_10KBPS_10MS_FRAME, NULL);
break;
}
_nop_(); // for debug
Linklayer_Start(linkInstPtr);
Status = SUCCESS;
break;
}