forked from xuos/xiuos
add ethernet for imxrt1176-sbc board and keep compatible with other boards
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
// #include <user_api.h>
|
||||
#include <transform.h>
|
||||
|
||||
extern void ShowTask();
|
||||
|
||||
extern int FrameworkInit();
|
||||
extern void ApplicationOtaTaskInit(void);
|
||||
int main(void)
|
||||
@@ -24,6 +26,10 @@ int main(void)
|
||||
#ifdef APPLICATION_OTA
|
||||
ApplicationOtaTaskInit();
|
||||
#endif
|
||||
while(1){
|
||||
// ShowTask();
|
||||
PrivTaskDelay(2000);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
// int cppmain(void);
|
||||
|
||||
+3
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user