From afb403ae53acf5e9f12b70af066c234b567af313 Mon Sep 17 00:00:00 2001 From: maxxir Date: Fri, 18 Jan 2019 22:31:53 +0400 Subject: [PATCH] Add double-IP config for [03_m1284p_WIZNET_loopback_STATIC_IP] --- 03_m1284p_WIZNET_loopback_STATIC_IP/globals.h | 2 ++ 03_m1284p_WIZNET_loopback_STATIC_IP/main.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/03_m1284p_WIZNET_loopback_STATIC_IP/globals.h b/03_m1284p_WIZNET_loopback_STATIC_IP/globals.h index 8cdf10c..dc9885a 100644 --- a/03_m1284p_WIZNET_loopback_STATIC_IP/globals.h +++ b/03_m1284p_WIZNET_loopback_STATIC_IP/globals.h @@ -36,6 +36,8 @@ static FATFS Fatfs; //File system object for each logical drive. >= 2 #define PRINTF(...) #endif +//#define IP_WORK + extern unsigned long millis(void); extern int freeRam (void); diff --git a/03_m1284p_WIZNET_loopback_STATIC_IP/main.c b/03_m1284p_WIZNET_loopback_STATIC_IP/main.c index 3fab424..26c5b3f 100644 --- a/03_m1284p_WIZNET_loopback_STATIC_IP/main.c +++ b/03_m1284p_WIZNET_loopback_STATIC_IP/main.c @@ -23,13 +23,23 @@ #define _MAIN_DEBUG_ -//NIC metrics +#ifdef IP_WORK +//NIC metrics for WORK PC +wiz_NetInfo netInfo = { .mac = {0x00, 0x08, 0xdc, 0xab, 0xcd, 0xef}, // Mac address + .ip = {192, 168, 0, 199}, // IP address + .sn = {255, 255, 255, 0}, // Subnet mask + .dns = {8,8,8,8}, // DNS address (google dns) + .gw = {192, 168, 0, 1}, // Gateway address + .dhcp = NETINFO_STATIC}; //Dynamic IP configuration from a DHCP sever +#else +//NIC metrics for another PC (second IP configuration) wiz_NetInfo netInfo = { .mac = {0x00, 0x08, 0xdc, 0xab, 0xcd, 0xef}, // Mac address .ip = {192, 168, 1, 199}, // IP address .sn = {255, 255, 255, 0}, // Subnet mask .dns = {8,8,8,8}, // DNS address (google dns) .gw = {192, 168, 1, 1}, // Gateway address .dhcp = NETINFO_STATIC}; //Dynamic IP configuration from a DHCP sever +#endif /*