fix: 接收帧类型改为通过数据读取

This commit is contained in:
2025-05-25 23:16:16 +08:00
parent 46ca71c78a
commit e94f2b3848
6 changed files with 69 additions and 86 deletions
+24 -24
View File
@@ -42,7 +42,7 @@
/************************** Function Prototypes ******************************/
int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr);
void Phy_IntrHandler(void *context);
void PeriodicPull_Handler(void *callBackRef);
void PeriodicPoll_Handler(void *callBackRef);
void AppTimer_IntrHandler(void *context);
void Systembus_RxIntrHandler(void *context);
void Systembus_TxIntrHandler(void *context);
@@ -53,8 +53,8 @@ struct callback_desc phy_callback_desc = {
.ctx = NULL
};
struct callback_desc periodicpull_callback_desc = {
.callback = PeriodicPull_Handler,
struct callback_desc periodicpoll_callback_desc = {
.callback = PeriodicPoll_Handler,
.ctx = NULL
};
@@ -76,10 +76,10 @@ struct callback_desc apptimer_callback_desc = {
//L2_CONFIG linkConfig = {
// .myType = L2_NODE_HEAD,
// .clustId = 1,
// .myId = 1,
// .headId = 1,
// .netScale = 3,
// .clustId = 1U,
// .myId = 1U,
// .headId = 1U,
// .netScale = 10U,
// .serviceRate = L2_SVC_512K,
// .phyInstPtr = NULL, // physical layer reference
// .tmcInstPtr = NULL
@@ -87,10 +87,10 @@ struct callback_desc apptimer_callback_desc = {
L2_CONFIG linkConfig = {
.myType = L2_NODE_MEMBER,
.clustId = 1,
.myId = 2,
.headId = 1,
.netScale = 10,
.clustId = 1U,
.myId = 2U,
.headId = 1U,
.netScale = 10U,
.serviceRate = L2_SVC_512K,
.phyInstPtr = NULL, // physical layer reference
.tmcInstPtr = NULL
@@ -115,21 +115,22 @@ static PHY_CONFIG phyConfig = {
TMC_CONFIG tmcConfig = {
.baseAddr = TIME_CONTROLLER_BASEADDR,
.reset = 10
.reset = 10U
};
static SYSBUS_CONFIG sysbusConfig = {
.baseAddr = SYSBUS_BASE_ADDR,
.txQueueMax = 16,
.rxQueueMax = 16
.txQueueMax = 16U,
.rxQueueMax = 16U
};
/*********************** Driver Instance Definitions **************************/
static struct irq_ctrl_desc *intcDescPtr; // General interrupt controller descriptor
static struct timer_desc *logTmPtr;
static SYSBUS *sysbusDescPtr;
static PHY_INST *phyInstPtr;
static struct irq_ctrl_desc *intcDescPtr = NULL; // General interrupt controller descriptor
static struct timer_desc *logTmPtr = NULL;
static SYSBUS *sysbusDescPtr = NULL;
static PHY_INST *phyInstPtr = NULL;
static TMC_INST *tmcInstPtr = NULL;
L2_INST *linkInstPtr;
L2_INST *linkInstPtr = NULL;
#ifdef HSJL_GE // Zynq MPSoC (Zynq UltraScale+)
void MetalLogHandler(enum metal_log_level level, const char *format, ...)
@@ -225,7 +226,7 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
return Status;
}
// Connect the interrupt service routine isr1 to the interrupt controller
Status = irq_register_callback(descPtr, PERIODIC_5MS_INTR_ID, &periodicpull_callback_desc);
Status = irq_register_callback(descPtr, PERIODIC_5MS_INTR_ID, &periodicpoll_callback_desc);
if (Status != SUCCESS)
{
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
@@ -317,17 +318,16 @@ void Phy_IntrHandler(void *context)
Phy_UpdateState(phyInstPtr);
} // PhyIntr_Handler
/****************************************************************************/
/**
* Handler of periodic 5ms interrupt
* Handler of periodic 2 ms interrupt
*
* @param callBackRef is the linklayer instance pointer.
*
* @return None.
*
*****************************************************************************/
void PeriodicPull_Handler(void *callBackRef)
void PeriodicPoll_Handler(void *callBackRef)
{
int32_t Status;
Status = Linklayer_Proc(linkInstPtr);
@@ -336,7 +336,7 @@ void PeriodicPull_Handler(void *callBackRef)
DBG_ERROR("Link layer runs failed, with error code: %" PRId32 "\n", Status);
_nop_();
}
} // PeriodicPull_Handler
} // PeriodicPoll_Handler
/*****************************************************************************/
/**