Skip to content

Commit a133ab5

Browse files
authored
Merge pull request #218 from mghie/nano-every-fix
Fixes static IPs for Arduino Nano Every
2 parents 9e8a98c + 72462ca commit a133ab5

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/Ethernet.cpp

+3-13
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,9 @@ void EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns, IPAddress g
8383
if (W5100.init() == 0) return;
8484
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
8585
W5100.setMACAddress(mac);
86-
#ifdef ESP8266
87-
W5100.setIPAddress(&ip[0]);
88-
W5100.setGatewayIp(&gateway[0]);
89-
W5100.setSubnetMask(&subnet[0]);
90-
#elif ARDUINO > 106 || TEENSYDUINO > 121
91-
W5100.setIPAddress(ip._address.bytes);
92-
W5100.setGatewayIp(gateway._address.bytes);
93-
W5100.setSubnetMask(subnet._address.bytes);
94-
#else
95-
W5100.setIPAddress(ip._address);
96-
W5100.setGatewayIp(gateway._address);
97-
W5100.setSubnetMask(subnet._address);
98-
#endif
86+
W5100.setIPAddress(ip.raw_address());
87+
W5100.setGatewayIp(gateway.raw_address());
88+
W5100.setSubnetMask(subnet.raw_address());
9989
SPI.endTransaction();
10090
_dnsServerAddress = dns;
10191
}

0 commit comments

Comments
 (0)