Add globals.c in [03_m1284p_WIZNET_loopback_STATIC_IP]

master
maxxir_w 7 years ago
parent 5f09015a4e
commit 1338fb35dd

@ -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

@ -13,6 +13,9 @@
#include <avr/pgmspace.h>
#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_ */

@ -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