rs485 to ethernet
Dependencies: BufferedSerialttt
Fork of Serial-to-Ethernet by
Diff: main.cpp
- Revision:
- 2:1af7ad1f058a
- Parent:
- 1:c53f82eb6b42
--- a/main.cpp Fri Sep 01 02:30:10 2017 +0000 +++ b/main.cpp Fri Sep 08 08:54:15 2017 +0000 @@ -8,12 +8,13 @@ #include "ste_config.h" + /* If define USE_STATIC_IP, specify the default IP address. */ -#if 0 +#if 1 // private IP address for general purpose #define IP_ADDRESS "192.168.1.2" #define NETWORK_MASK "255.255.255.0" -#define GATEWAY_ADDRESS "192.168.1.1" +#define GATEWAY_ADDRESS "192.168.1.254" #else // private IP address only for test with Windows when DHCP server doesn't exist. #define IP_ADDRESS "169.254.108.2" @@ -26,13 +27,13 @@ #if defined (TARGET_NUMAKER_PFM_M487) BufferedSerial serial_0(PH_8, PH_9, 256, 4); // UART1 -BufferedSerial serial_1(PA_5, PA_4, 256, 4); // UART5 +//BufferedSerial serial_1(PA_5, PA_4, 256, 4); // UART5 //BufferedSerial serial_1(PC_12, PC_11, 256, 4); // UART0, Debug -#elif defined (TARGET_NUMAKER_PFM_NUC472) -BufferedSerial serial_0(PH_1, PH_0, 256, 4); // UART4 -BufferedSerial serial_1(PG_2, PG_1, 256, 4); // UART0 -BufferedSerial serial_2(PC_11, PC_10, 256, 4); // UART2 +//#elif defined (TARGET_NUMAKER_PFM_NUC472) +//BufferedSerial serial_0(PH_1, PH_0, 256, 4); // UART4 +//BufferedSerial serial_1(PG_2, PG_1, 256, 4); // UART0 +//BufferedSerial serial_2(PC_11, PC_10, 256, 4); // UART2 #elif defined (TARGET_NUMAKER_PFM_M453) || defined(TARGET_NUMAKER_PFM_NANO130) #error The board has no Ethernet. @@ -315,7 +316,7 @@ thread[i].start(callback(bridge_net_client, &(port_config[i]))); } } - + #ifdef ENABLE_WEB_CONFIG /*** main thread to be a web server for configuration ***/