print enhance: check start time at the beginning of linklayer proc, avoiding wired print message.

This commit is contained in:
Gatsby Van
2024-01-24 11:39:42 +08:00
parent 694759b395
commit 3ed509e08c
@@ -1128,15 +1128,6 @@ static int32_t Linklayer_Routine(L2_INST *instPtr)
ASSERT(instPtr != NULL);
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;
@@ -1217,6 +1208,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);