add tx/rx mode record to L2_INST
This commit is contained in:
@@ -570,6 +570,7 @@ void L2_FrameStateUpdate(L2_INST* instPtr) {
|
|||||||
|
|
||||||
// Frame types shift (last <- curr <- next)
|
// Frame types shift (last <- curr <- next)
|
||||||
L2_RcdShift(&(instPtr->frame), L2_NONE_FRAME);
|
L2_RcdShift(&(instPtr->frame), L2_NONE_FRAME);
|
||||||
|
L2_RcdShift(&(instPtr->tor), L2_TOR_SUSPEND);
|
||||||
|
|
||||||
// Update frame state.
|
// Update frame state.
|
||||||
if (Phy_IsFrameValid(phyRef) == false) {
|
if (Phy_IsFrameValid(phyRef) == false) {
|
||||||
@@ -721,6 +722,10 @@ int32_t L2_SetupNextSlot(L2_INST* instPtr, L2_TOR_TYPE txrxMode, L2_FRAME_TYPE f
|
|||||||
torStr, frameStr);
|
torStr, frameStr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Update frame and tx/rx mode record.
|
||||||
|
instPtr->frame.next = frameType;
|
||||||
|
instPtr->tor.next = txrxMode;
|
||||||
|
|
||||||
TIME_WORD pullTime = {0, 0};
|
TIME_WORD pullTime = {0, 0};
|
||||||
pullTime.int_part = TimeCtrl_GetIntCnt(instPtr->config.tmcInstPtr) + 1;
|
pullTime.int_part = TimeCtrl_GetIntCnt(instPtr->config.tmcInstPtr) + 1;
|
||||||
Status = Phy_SetTimeWord(phyRef, &pullTime, TIME_WORD_POLL);
|
Status = Phy_SetTimeWord(phyRef, &pullTime, TIME_WORD_POLL);
|
||||||
@@ -922,6 +927,9 @@ int32_t Linklayer_Init(L2_INST** instPtr, const L2_CONFIG *config) {
|
|||||||
(*instPtr)->frame.last = L2_NONE_FRAME;
|
(*instPtr)->frame.last = L2_NONE_FRAME;
|
||||||
(*instPtr)->frame.curr = L2_NONE_FRAME;
|
(*instPtr)->frame.curr = L2_NONE_FRAME;
|
||||||
(*instPtr)->frame.next = L2_NONE_FRAME;
|
(*instPtr)->frame.next = L2_NONE_FRAME;
|
||||||
|
(*instPtr)->tor.last = L2_TOR_SUSPEND;
|
||||||
|
(*instPtr)->tor.curr = L2_TOR_SUSPEND;
|
||||||
|
(*instPtr)->tor.next = L2_TOR_SUSPEND;
|
||||||
(*instPtr)->rtneConfig.rtneTable = initTable;
|
(*instPtr)->rtneConfig.rtneTable = initTable;
|
||||||
(*instPtr)->rtneConfig.rtnePrd = ARRAY_SIZE(initTable);
|
(*instPtr)->rtneConfig.rtnePrd = ARRAY_SIZE(initTable);
|
||||||
(*instPtr)->mainState = INIT_STATE;
|
(*instPtr)->mainState = INIT_STATE;
|
||||||
@@ -1003,6 +1011,9 @@ int32_t Linklayer_Reconfig(L2_INST* instPtr, const L2_CONFIG *config) {
|
|||||||
instPtr->frame.last = L2_NONE_FRAME;
|
instPtr->frame.last = L2_NONE_FRAME;
|
||||||
instPtr->frame.curr = L2_NONE_FRAME;
|
instPtr->frame.curr = L2_NONE_FRAME;
|
||||||
instPtr->frame.next = L2_NONE_FRAME;
|
instPtr->frame.next = L2_NONE_FRAME;
|
||||||
|
instPtr->tor.last = L2_TOR_SUSPEND;
|
||||||
|
instPtr->tor.curr = L2_TOR_SUSPEND;
|
||||||
|
instPtr->tor.next = L2_TOR_SUSPEND;
|
||||||
instPtr->rtneConfig.rtneTable = initTable;
|
instPtr->rtneConfig.rtneTable = initTable;
|
||||||
instPtr->rtneConfig.rtnePrd = ARRAY_SIZE(initTable);
|
instPtr->rtneConfig.rtnePrd = ARRAY_SIZE(initTable);
|
||||||
instPtr->mainState = INIT_STATE;
|
instPtr->mainState = INIT_STATE;
|
||||||
|
|||||||
Reference in New Issue
Block a user