bugfix: net start check should apply at the beginning of linklayer proc.

This commit is contained in:
Gatsby Van
2024-01-23 15:28:28 +08:00
parent 417e566e3d
commit 0f5526736d
+9 -9
View File
@@ -1227,15 +1227,6 @@ static int32_t Linklayer_Routine(L2_INST *instPtr)
int32_t Status;
uint32_t tableIndx, entryIndx;
// FIXME: Consider time wrapping.
uint32_t nextTimeUnit = (TimeCtrl_GetIntCnt(instPtr->config.tmcInstPtr) + 1) / L2_SLOTS_PER_FRAME;
if (nextTimeUnit < instPtr->netStartTime)
{
DBG_WARNING("Linklayer not start yet, next time unit: %u, start time unit: %u.\n",
nextTimeUnit, instPtr->netStartTime);
return EIGNORE;
}
// Determine which routine entry is going to be performed.
tableIndx = L2_GetNextFrameNum(instPtr) % instPtr->rtneConfig.rtnePrd;
entryIndx = L2_GetNextSlotNum(instPtr);
@@ -1317,6 +1308,15 @@ int32_t Linklayer_Proc(L2_INST *instPtr)
return SUCCESS;
}
// FIXME: Consider time wrapping.
uint32_t nextTimeUnit = (TimeCtrl_GetIntCnt(instPtr->config.tmcInstPtr) + 1) / L2_SLOTS_PER_FRAME;
if (nextTimeUnit < instPtr->netStartTime)
{
DBG_WARNING("Linklayer not start yet, next time unit: %u, start time unit: %u.\n",
nextTimeUnit, instPtr->netStartTime);
return EIGNORE;
}
// Update slot number.
L2_UpdateSlotNum(instPtr);