Firmware for the controller of the JRO Radar Controller.
Dependencies: CR2 EthernetInterface FreescaleIAP I2CLCD SerialDriver jro k64f_EthLink mbed-rtos mbed
Fork of JRO_DDSv2 by
test_eth.cpp
- Committer:
- joaquinbvw
- Date:
- 2016-03-14
- Revision:
- 6:20e6ba387783
- Parent:
- 3:f84802422619
File content as of revision 6:20e6ba387783:
#if 0 #include "mbed.h" #include "rtos.h" #include "EthernetInterface.h" RawSerial pc(USBTX, USBRX); EthernetInterface eth; #define IP_INI "10.10.50.85"; // IP #define MASK_INI "255.255.255.0"; // MASK #define GATEWAY_INI "10.10.50.1"; // GATEWAY const char* IP = IP_INI; // IP const char* MASK = MASK_INI; // MASK const char* GATEWAY = GATEWAY_INI; // GATEWAY int main(){ pc.printf("Initializing network interface...\r\n"); if (0 == eth.init(IP, MASK, GATEWAY)) { // It should always take this path do { pc.printf("Connecting to network...\r\n"); if (0 == eth.connect()) { pc.printf("Ethernet connected as %s\r\n", eth.getIPAddress()); Thread::wait(5000); pc.printf("lost connection.\r\n"); eth.disconnect(); } else { pc.printf(" ... failed to connect.\r\n"); } } while (1); } else { pc.printf(" ... failed to initialize, rebooting...\r\n"); } } #endif