Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes static IPs for Arduino Nano Every #218

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 3 additions & 13 deletions src/Ethernet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,9 @@ void EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns, IPAddress g
if (W5100.init() == 0) return;
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
W5100.setMACAddress(mac);
#ifdef ESP8266
W5100.setIPAddress(&ip[0]);
W5100.setGatewayIp(&gateway[0]);
W5100.setSubnetMask(&subnet[0]);
#elif ARDUINO > 106 || TEENSYDUINO > 121
W5100.setIPAddress(ip._address.bytes);
W5100.setGatewayIp(gateway._address.bytes);
W5100.setSubnetMask(subnet._address.bytes);
#else
W5100.setIPAddress(ip._address);
W5100.setGatewayIp(gateway._address);
W5100.setSubnetMask(subnet._address);
#endif
W5100.setIPAddress(ip.raw_address());
W5100.setGatewayIp(gateway.raw_address());
W5100.setSubnetMask(subnet.raw_address());
SPI.endTransaction();
_dnsServerAddress = dns;
}
Expand Down