From 9ec89eee92d6e6ca80fe17e2e3e7a9a824291e68 Mon Sep 17 00:00:00 2001 From: maxxir Date: Mon, 21 Jan 2019 21:38:27 +0400 Subject: [PATCH] Add double-IP config for [12_m1284p_WIZNET_HTTPServer_SDCARD_pages] --- 12_m1284p_WIZNET_HTTPServer_SDCARD_pages/globals.h | 2 ++ 12_m1284p_WIZNET_HTTPServer_SDCARD_pages/main.c | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/12_m1284p_WIZNET_HTTPServer_SDCARD_pages/globals.h b/12_m1284p_WIZNET_HTTPServer_SDCARD_pages/globals.h index e17cbf5..bfb99a4 100644 --- a/12_m1284p_WIZNET_HTTPServer_SDCARD_pages/globals.h +++ b/12_m1284p_WIZNET_HTTPServer_SDCARD_pages/globals.h @@ -32,6 +32,8 @@ #define PRINTF(...) #endif +//#define IP_WORK + extern unsigned long millis(void); extern int freeRam (void); diff --git a/12_m1284p_WIZNET_HTTPServer_SDCARD_pages/main.c b/12_m1284p_WIZNET_HTTPServer_SDCARD_pages/main.c index 35d43c0..1d939d9 100644 --- a/12_m1284p_WIZNET_HTTPServer_SDCARD_pages/main.c +++ b/12_m1284p_WIZNET_HTTPServer_SDCARD_pages/main.c @@ -24,13 +24,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 + .dhcp = NETINFO_STATIC}; //Static IP configuration +#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}; //Static IP configuration +#endif //#include "Application/loopback/loopback.h"