2 Commits
Author SHA1 Message Date
Gatsby Van 22417853dd enhanced code inherence 2024-03-02 13:14:17 +08:00
Gatsby Van 633f6dff37 bugfix: correct api call 2024-03-02 13:13:20 +08:00
5 changed files with 12 additions and 12 deletions
@@ -406,7 +406,7 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
L2_FrameGetChunk(msg, L2_MSG_ADV_SRC_POSZ, L2_MSG_ADV_SRC_POSZ_LEN, &nodePos);
node->nodeInfo.pos.z = (double) nodePos;
node->nodeInfo.beamNo = Phy_LastScanBeamNo(instPtr->config.phyInstPtr);
// log last scan beam number
instPtr->log.scanBeamNo = node->nodeInfo.beamNo;
@@ -608,12 +608,12 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
if (rtneEntry->dst == L2_GetNodeId(instPtr) || rtneEntry->dst == L2_BROADCAST_ID)
{
torState = L2_TOR_RX;
commNode = L2_GetNodeById(rtneEntry->dst);
commNode = L2_GetNodeById(instPtr->nodeList, rtneEntry->dst);
}
else if (rtneEntry->src == L2_GetNodeId(instPtr) || rtneEntry->src == L2_BROADCAST_ID)
{
torState = L2_TOR_TX;
commNode = L2_GetNodeById(rtneEntry->src);
commNode = L2_GetNodeById(instPtr->nodeList, rtneEntry->src);
}
else
{
@@ -624,7 +624,7 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_25;
if (commNode != NULL)
{
Phy_SetBeamNo(commNode->nodeInfo.beamNo);
Phy_SetBeamNo(instPtr->config.phyInstPtr, commNode->nodeInfo.beamNo);
}
}
else
@@ -373,12 +373,12 @@ int32_t L2_Service_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntr
if (rtneEntry->src == L2_GetNodeId(instPtr))
{
torState = L2_TOR_TX;
commNode = L2_GetNodeById(rtneEntry->src);
commNode = L2_GetNodeById(instPtr->nodeList, rtneEntry->src);
}
else if (rtneEntry->dst == L2_GetNodeId(instPtr))
{
torState = L2_TOR_RX;
commNode = L2_GetNodeById(rtneEntry->src);
commNode = L2_GetNodeById(instPtr->nodeList, rtneEntry->src);
}
else
{
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <math.h>
#include "phy_layer.h"
#include "phy_reg.h"
#include "util.h"
#include "error.h"
#ifndef EMULATION
@@ -481,13 +482,13 @@ int32_t Phy_InstInit(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
goto init_error;
}
memccpy(antConfigBram.config.MemBaseAddress,
memcpy((void*)antConfigBram.Config.MemBaseAddress,
antSubnrrwPattern, sizeof(antSubnrrwPattern));
uint32_t phyMainCtrl = PhyRead(*instPtr, PHY_MAIN_CTRL);
phyMainCtrl &= ~PHY_MAIN_CTRL_NSCAN_MASK;
phyMainCtrl |= PHY_MAIN_CTRL_NSCAN_MASK &
phyMainCtrl |= PHY_MAIN_CTRL_NSCAN_MASK &
(L1_NUM_ANT_SUBNRRW_PATTERN << PHY_MAIN_CTRL_NSCAN_SHIFT);
PhyWrite(*instPtr, phyMainCtrl);
PhyWrite(*instPtr, PHY_MAIN_CTRL, phyMainCtrl);
}
/* Initialize the XAdc driver. */
@@ -26,7 +26,6 @@
/***************************** Include Files *********************************/
#include <stdint.h>
#include "phy_reg.h"
#include "common.h"
#ifndef EMULATION
#include "xbram.h"
@@ -26,8 +26,8 @@
#include "util.h"
/***************** Macros (Inline Functions) Definitions *********************/
#define PhyRead(instPtr, addr) IO_In32(instPtr->phyCofig.baseAddr + addr)
#define PhyWrite(instPtr, addr, value) IO_Out32(instPtr->phyCofig.baseAddr + addr, value)
#define PhyRead(instPtr, addr) IO_In32((instPtr)->phyCofig.baseAddr + addr)
#define PhyWrite(instPtr, addr, value) IO_Out32((instPtr)->phyCofig.baseAddr + addr, value)
/************************** Constant Definitions *****************************/
/**