auto detection of ethernet cable

08 Jun 2012

void setNTP () { EthernetErr ethErr = eth.setup(); Host server(IpAddr(), 123, "0.uk.pool.ntp.org"); ntp.setTime(server); pc.printf("NTP is set up\n"); wait(10); pc.printf("Clock is synchronised. Cable can now removed");

}

/* Checks if a connection to the ethernet is established */ if (connect.link()) { connect1 = connect1 + 1; if (connect1 == 1) { setNTP();

} else { does nothing } }

my code just gets stucked at "EthernetErr ethErr = eth.setup(); " and wouldn't connect to the NTP server at all. Can anyone help me with this?