Add double-IP config for [08_m1284p_WIZNET_ICMP_aka_ping]
This commit is contained in:
@@ -56,6 +56,26 @@
|
|||||||
#define sw1_conf() {DDRC &= ~(1<<DDC5); PORTC |= (1<<PORTC5);}
|
#define sw1_conf() {DDRC &= ~(1<<DDC5); PORTC |= (1<<PORTC5);}
|
||||||
#define sw1_read() (PINC & (1<<PINC5))
|
#define sw1_read() (PINC & (1<<PINC5))
|
||||||
|
|
||||||
|
#ifdef IP_WORK
|
||||||
|
uint8_t ping_ip[4] = { 192, 168, 0, 100 }; //Ping IP address
|
||||||
|
//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
|
||||||
|
uint8_t ping_ip[4] = { 192, 168, 1, 81 }; //Ping IP address
|
||||||
|
//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
|
||||||
|
|
||||||
//*********Global vars
|
//*********Global vars
|
||||||
#define TICK_PER_SEC 1000UL
|
#define TICK_PER_SEC 1000UL
|
||||||
volatile unsigned long _millis; // for millis tick !! Overflow every ~49.7 days
|
volatile unsigned long _millis; // for millis tick !! Overflow every ~49.7 days
|
||||||
@@ -216,13 +236,6 @@ uint16_t adc_read(uint8_t channel)
|
|||||||
unsigned char ethBuf0[ETH_MAX_BUF_SIZE];
|
unsigned char ethBuf0[ETH_MAX_BUF_SIZE];
|
||||||
unsigned char ethBuf1[ETH_MAX_BUF_SIZE];
|
unsigned char ethBuf1[ETH_MAX_BUF_SIZE];
|
||||||
|
|
||||||
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 configruation from a DHCP sever
|
|
||||||
|
|
||||||
void cs_sel() {
|
void cs_sel() {
|
||||||
SPI_WIZNET_ENABLE();
|
SPI_WIZNET_ENABLE();
|
||||||
}
|
}
|
||||||
@@ -360,7 +373,6 @@ int main()
|
|||||||
//ping_request(2, netInfo.gw);
|
//ping_request(2, netInfo.gw);
|
||||||
|
|
||||||
PRINTF("\r\n>> PING my PC\r\n");
|
PRINTF("\r\n>> PING my PC\r\n");
|
||||||
uint8_t ping_ip[4] = { 192, 168, 0, 100 };
|
|
||||||
ping_request(2, ping_ip); //DEVELOPER PC IP
|
ping_request(2, ping_ip); //DEVELOPER PC IP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user