enhance code inherence

This commit is contained in:
Gatsby Van
2024-03-07 11:40:53 +08:00
parent ec772ba9e3
commit c09bd57408
3 changed files with 84 additions and 37 deletions
+3 -3
View File
@@ -430,19 +430,19 @@ int32_t SystemBus_HandleCmd(SYSBUS *instPtr)
if(data[WD_EN_CMD] == EN_CMD_ON_HIGH_POWER)
{
// high power config
Phy_AntConfigMode(phyRef, PHY_ANT_MODE_HIGH_POWER);
Phy_AntConfigMode(phyRef, PHY_ANT_MODE_POWER_FULL);
}
else if(data[WD_EN_CMD] == EN_CMD_ON_LOW_POWER)
{
// low power config
Phy_AntConfigMode(phyRef, PHY_ANT_MODE_LOW_POWER);
Phy_AntConfigMode(phyRef, PHY_ANT_MODE_POWER_LOW);
}
else if(data[WD_EN_CMD] == EN_CMD_SILENT)
{
// silence config
// TODO: better approach?
Linklayer_Halt(linkInstPtr);
Phy_AntConfigMode(phyRef, PHY_ANT_MODE_SILENT);
Phy_AntConfigMode(phyRef, PHY_ANT_MODE_STANDBY);
TIME_WORD pullTime = {0, 0};
pullTime.int_part = TimeCtrl_GetIntCnt(tmcRef) + 1;
Status = Phy_SetTimeWord(phyRef, &pullTime, PHY_TIME_WORD_POLL);