From 2a17fa9183ee81e0137488452b43b8a6a950ebf1 Mon Sep 17 00:00:00 2001 From: Gatsby Van Date: Fri, 22 Dec 2023 13:18:38 +0800 Subject: [PATCH] bugfix: reveal physical flag directly. --- datalink814_ge/src/phy_ctrl/phy_ctrl.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/datalink814_ge/src/phy_ctrl/phy_ctrl.c b/datalink814_ge/src/phy_ctrl/phy_ctrl.c index 4dc8bb3..6c440f9 100644 --- a/datalink814_ge/src/phy_ctrl/phy_ctrl.c +++ b/datalink814_ge/src/phy_ctrl/phy_ctrl.c @@ -86,7 +86,7 @@ static int32_t Phy_SetSendData(PHY_INST* instPtr, L1_FRAME_TYPE frameType, uint8 ******************************************************************************/ inline bool Phy_IsFrameDetected(PHY_INST* instPtr) { ASSERT(instPtr != NULL); - if(instPtr->TOR.last == PHY_TOR_RX && instPtr->isAcq && instPtr->isFrameSync) { + if(instPtr->isAcq && instPtr->isFrameSync) { return true; } else { @@ -107,8 +107,7 @@ inline bool Phy_IsFrameDetected(PHY_INST* instPtr) { ******************************************************************************/ inline bool Phy_IsFrameReceived(PHY_INST* instPtr) { ASSERT(instPtr != NULL); - if(instPtr->TOR.last == PHY_TOR_RX && instPtr->isAcq - && instPtr->isFrameSync && instPtr->isDecode) { + if(instPtr->isAcq && instPtr->isFrameSync && instPtr->isDecode) { return true; } else { @@ -129,13 +128,7 @@ inline bool Phy_IsFrameReceived(PHY_INST* instPtr) { ******************************************************************************/ inline bool Phy_IsFrameValid(PHY_INST* instPtr) { ASSERT(instPtr != NULL); - if (instPtr->TOR.last == PHY_TOR_RX && instPtr->isAcq && instPtr->isFrameSync - && instPtr->isDecode && instPtr->isValid) { - return true; - } - else { - return false; - } + return instPtr->isValid; } /*****************************************************************************/ @@ -238,11 +231,6 @@ uint32_t Phy_GetFrameLen(L1_FRAME_TYPE frameType) { void Phy_UpdateState(PHY_INST* instPtr) { ASSERT(instPtr != NULL); - Phy_RcdShift(&(instPtr->TOR),PHY_TOR_SUSPEND); - Phy_RcdShift(&(instPtr->frameType),L1_NONE_FRAME); - Phy_RcdShift(&(instPtr->antNo), INIT_ANT_NO); - Phy_RcdShift(&(instPtr->beamNo), INIT_BEAM_NO); - Phy_RcdShift(&(instPtr->beamWd), INIT_ANT_WD); /* Update Frame Sate. */ uint32_t txrxSate = PhyRead(instPtr, TXRX_STATE); instPtr->isAcq = ((txrxSate & TXRX_STATE_ACQ_MASK) == TXRX_STATE_ACQ_SUCCESS) ? true : false; @@ -254,7 +242,12 @@ void Phy_UpdateState(PHY_INST* instPtr) { else { instPtr->isValid = false; } - return; + + Phy_RcdShift(&(instPtr->TOR),PHY_TOR_SUSPEND); + Phy_RcdShift(&(instPtr->frameType),L1_NONE_FRAME); + Phy_RcdShift(&(instPtr->antNo), INIT_ANT_NO); + Phy_RcdShift(&(instPtr->beamNo), INIT_BEAM_NO); + Phy_RcdShift(&(instPtr->beamWd), INIT_ANT_WD); }