add ethernet for imxrt1176-sbc board and keep compatible with other boards

This commit is contained in:
Wang_Weigen
2022-09-28 09:15:51 +08:00
parent 85ed3a2c10
commit 088bf02fbd
72 changed files with 14986 additions and 113 deletions
@@ -139,6 +139,8 @@ This function initializes the Ethernet driver.
//------------------------------------------------------------------------------
tOplkError edrv_init(const tEdrvInitParam* pEdrvInitParam_p)
{
uint8_t enet_port = 0; ///< use enet port 0
// Check parameter validity
ASSERT(pEdrvInitParam_p != NULL);
@@ -153,7 +155,7 @@ tOplkError edrv_init(const tEdrvInitParam* pEdrvInitParam_p)
edrvInstance_l.fStartCommunication = TRUE;
lwip_config_net(lwip_ipaddr, lwip_netmask, lwip_gwaddr);
lwip_config_net(enet_port, lwip_ipaddr, lwip_netmask, lwip_gwaddr);
gnetif.input = ethernetInput;
edrvInstance_l.pNetif = &gnetif;
@@ -347,6 +347,7 @@ void PlcSocketTask(int argc, char *argv[])
{
int result = 0;
pthread_t th_id;
uint8_t enet_port = 0; ///< test enet port 0
pthread_attr_t attr;
attr.schedparam.sched_priority = LWIP_DEMO_TASK_PRIO;
@@ -355,7 +356,7 @@ void PlcSocketTask(int argc, char *argv[])
PlcCheckParam(argc, argv);
lwip_config_net(lwip_ipaddr, lwip_netmask, param->ip);
lwip_config_net(enet_port, lwip_ipaddr, lwip_netmask, param->ip);
PrivTaskCreate(&th_id, &attr, PlcSocketStart, param);
}