diff --git a/03_m1284p_WIZNET_loopback_STATIC_IP/globals.c b/03_m1284p_WIZNET_loopback_STATIC_IP/globals.c new file mode 100644 index 0000000..6b51aa0 --- /dev/null +++ b/03_m1284p_WIZNET_loopback_STATIC_IP/globals.c @@ -0,0 +1,26 @@ +/* + * globals.c + * + * Created on: 07 февр. 2019 г. + * Author: maxx + */ +#include "globals.h" + +#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}; //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 + diff --git a/03_m1284p_WIZNET_loopback_STATIC_IP/globals.h b/03_m1284p_WIZNET_loopback_STATIC_IP/globals.h index dc9885a..f8c52ea 100644 --- a/03_m1284p_WIZNET_loopback_STATIC_IP/globals.h +++ b/03_m1284p_WIZNET_loopback_STATIC_IP/globals.h @@ -13,6 +13,9 @@ #include #include "avr/wdt.h" // WatchDog +#include "Ethernet/socket.h" +#include "Ethernet/wizchip_conf.h" + //******************************* Fat FS declare related: BEGIN /* #include "string.h" @@ -36,7 +39,7 @@ static FATFS Fatfs; //File system object for each logical drive. >= 2 #define PRINTF(...) #endif -//#define IP_WORK +#define IP_WORK extern unsigned long millis(void); extern int freeRam (void); @@ -57,5 +60,6 @@ extern const char compile_date[] PROGMEM; extern const char compile_time[] PROGMEM; extern const char str_prog_name[] PROGMEM; +extern wiz_NetInfo netInfo; #endif /* GLOBALS_H_ */ diff --git a/03_m1284p_WIZNET_loopback_STATIC_IP/main.c b/03_m1284p_WIZNET_loopback_STATIC_IP/main.c index 4e4266e..b2bb728 100644 --- a/03_m1284p_WIZNET_loopback_STATIC_IP/main.c +++ b/03_m1284p_WIZNET_loopback_STATIC_IP/main.c @@ -23,25 +23,6 @@ #define _MAIN_DEBUG_ -#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}; //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 - - /* * (3) Trying WIZNET5500 init with using official Wiznet ioLibrary_Driver * working ping, assign static IP