Good information Tsi-Chung.
Also once ksz code implemented ...
rtcs.c in the web_hvac example in the MQX_4.1.1/demos folder you can test following on twr-k60d100m tower kit:
ip_data.ip = ENET_IPADDR;
ip_data.mask = ENET_IPMASK;
ip_data.gateway = ENET_IPGATEWAY;
ENET_get_mac_address (DEMOCFG_DEFAULT_DEVICE, ENET_IPADDR, enet_address);
error = ipcfg_init_device (DEMOCFG_DEFAULT_DEVICE, enet_address);
//New code to test Ethernet cable connection.
{
int tries = 10;
bool found = false;
// Ethernet is device 0. Check for ethernet cable
while(tries-- && !found)
{
if(ipcfg_get_link_active(BSP_DEFAULT_ENET_DEVICE)) found = true;
else _time_delay(400);
}
if(!found)
{
printf("No Ethernet cable found.\n");
}
}
|
|
{ |
|
|
|
|
printf("No Ethernet cable found.\n"); |
|
|
} |
|
}
Sorry...cut-n-paste messed up the "{}" but you get the idea.
Regards,
David