chore: enhance code coherence
* distinct link layer parameter for GE and node application * disable remote test for node application * auto start link layer for node application
This commit is contained in:
+5
-23
@@ -84,6 +84,7 @@ struct callback_desc scutm_callback_desc =
|
||||
.ctx = NULL
|
||||
};
|
||||
|
||||
#ifdef _GE_APP_
|
||||
L2_CONFIG linkConfig = {
|
||||
.myType = L2_NODE_HEAD,
|
||||
.clustId = 1U,
|
||||
@@ -95,18 +96,9 @@ L2_CONFIG linkConfig = {
|
||||
.pushUpHandle = LinklayerPush2Up,
|
||||
.popUpHandle = LinklayerPopFromUp
|
||||
};
|
||||
|
||||
// L2_CONFIG linkConfig = {
|
||||
// .myType = L2_NODE_MEMBER,
|
||||
// .clustId = 1U,
|
||||
// .myId = 2U,
|
||||
// .headId = 1U,
|
||||
// .netScale = 2U,
|
||||
// .phyInstPtr = NULL, // physical layer reference
|
||||
// .tmcInstPtr = NULL,
|
||||
// .pushUpHandle = LinklayerPush2Up,
|
||||
// .popUpHandle = LinklayerPopFromUp
|
||||
// };
|
||||
#else
|
||||
#error No application type is specified.
|
||||
#endif
|
||||
|
||||
static PHY_CONFIG phyConfig =
|
||||
{
|
||||
@@ -284,7 +276,7 @@ static int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
irq_enable(descPtr, PERIODIC_5MS_INTR_ID);
|
||||
irq_enable(descPtr, MPC_RX_INTR_ID);
|
||||
irq_enable(descPtr, MPC_TX_INTR_ID);
|
||||
// irq_enable(descPtr, SCUTIMER_INTR_ID);
|
||||
irq_enable(descPtr, SCUTIMER_INTR_ID);
|
||||
|
||||
// Enable Exceptions
|
||||
Status = irq_global_enable(descPtr);
|
||||
@@ -546,15 +538,5 @@ int main(void)
|
||||
DBG_ERROR("Mpc_HandleCmd exit with ErrorCode: %" PRId32 ".\n", Status);
|
||||
}
|
||||
}
|
||||
if (Mpc_IsSvcDownPending(mpcDescPtr))
|
||||
{
|
||||
RING_BUFFER *msg = NULL;
|
||||
Mpc_PopSvcFrame(mpcDescPtr, (void**)&msg);
|
||||
Mpc_PushSvcFrame(mpcDescPtr, (void*)msg);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Mpc_HandleCmd exit with ErrorCode: %" PRId32 ".\n", Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // main
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#define _APP_VER_MINOR ((_APP_VER & 0x00FF0000) >> 16)
|
||||
#define _APP_VER_PATCH (_APP_VER & 0x0000FFFF)
|
||||
|
||||
#define _GE_APP_
|
||||
|
||||
/*********** Debug Info Level ************/
|
||||
// #define _DEBUG_LEVEL 1
|
||||
// 3 - print all debug info
|
||||
|
||||
+8
-18
@@ -66,10 +66,11 @@ struct callback_desc scutm_callback_desc = {
|
||||
.ctx = NULL
|
||||
};
|
||||
|
||||
#ifdef _NODE_APP_
|
||||
L2_CONFIG linkConfig = {
|
||||
.myType = L2_NODE_HEAD,
|
||||
.myType = L2_NODE_MEMBER,
|
||||
.clustId = 1U,
|
||||
.myId = 1U,
|
||||
.myId = 2U,
|
||||
.headId = 1U,
|
||||
.netScale = 2U,
|
||||
.phyInstPtr = NULL, // physical layer reference
|
||||
@@ -77,18 +78,9 @@ L2_CONFIG linkConfig = {
|
||||
.pushUpHandle = LinklayerPush2Up,
|
||||
.popUpHandle = LinklayerPopFromUp
|
||||
};
|
||||
|
||||
// L2_CONFIG linkConfig = {
|
||||
// .myType = L2_NODE_MEMBER,
|
||||
// .clustId = 1U,
|
||||
// .myId = 2U,
|
||||
// .headId = 1U,
|
||||
// .netScale = 2U,
|
||||
// .phyInstPtr = NULL, // physical layer reference
|
||||
// .tmcInstPtr = NULL,
|
||||
// .pushUpHandle = LinklayerPush2Up,
|
||||
// .popUpHandle = LinklayerPopFromUp
|
||||
// };
|
||||
#else
|
||||
#error No application type is specified.
|
||||
#endif
|
||||
|
||||
static PHY_CONFIG phyConfig = {
|
||||
.devId = PHY_DEVICE_ID,
|
||||
@@ -232,7 +224,7 @@ static int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
irq_enable(descPtr, PHY_INTR_ID);
|
||||
irq_enable(descPtr, PERIODIC_5MS_INTR_ID);
|
||||
irq_enable(descPtr, SYSBUS_INTR_ID);
|
||||
irq_enable(descPtr, SCUTIMER_INTR_ID);
|
||||
// irq_enable(descPtr, SCUTIMER_INTR_ID);
|
||||
|
||||
// Enable Exceptions
|
||||
Status = irq_global_enable(descPtr);
|
||||
@@ -428,9 +420,7 @@ int main(void)
|
||||
|
||||
DBG_PRINT("Physical started...\n");
|
||||
Phy_Start(phyInstPtr);
|
||||
|
||||
|
||||
// Linklayer_Start(linkInstPtr);
|
||||
Linklayer_Start(linkInstPtr);
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#define _APP_VER_MINOR ((_APP_VER & 0x00FF0000) >> 16)
|
||||
#define _APP_VER_PATCH (_APP_VER & 0x0000FFFF)
|
||||
|
||||
#define _NODE_APP_
|
||||
|
||||
/*********** Debug Info Level ************/
|
||||
// #define _DEBUG_LEVEL 1
|
||||
// 3 - print all debug info
|
||||
|
||||
Reference in New Issue
Block a user