Skip to content

Commit 4e61cdc

Browse files
authored
Update Ethernet.cpp
Moved function `configureStaticIP` to the end for (hopefully) proper diff alignment.
1 parent e8a5b4b commit 4e61cdc

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

libraries/Ethernet/src/Ethernet.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,6 @@ int CEthernet::begin(unsigned long timeout, unsigned long responseTimeout) {
3030
return 0;
3131
}
3232

33-
/* -------------------------------------------------------------------------- */
34-
int CEthernet::configureStaticIP(const IPAddress& local_ip, const IPAddress& dns_server, const IPAddress& gateway, const IPAddress& subnet) {
35-
/* -------------------------------------------------------------------------- */
36-
initializeTimer();
37-
38-
if (ni) {
39-
ni->config(local_ip, gateway, subnet);
40-
} else {
41-
ni = CLwipIf::getInstance().get(NI_ETHERNET, local_ip, gateway, subnet);
42-
if (!ni) return 0;
43-
}
44-
45-
ni->DhcpNotUsed();
46-
CLwipIf::getInstance().addDns(dns_server);
47-
return 1;
48-
}
49-
5033
/* -------------------------------------------------------------------------- */
5134
int CEthernet::begin(const IPAddress& local_ip) {
5235
/* -------------------------------------------------------------------------- */
@@ -205,4 +188,21 @@ IPAddress CEthernet::dnsServerIP() const {
205188
return CLwipIf::getInstance().getDns();
206189
}
207190

191+
/* -------------------------------------------------------------------------- */
192+
int CEthernet::configureStaticIP(const IPAddress& local_ip, const IPAddress& dns_server, const IPAddress& gateway, const IPAddress& subnet) {
193+
/* -------------------------------------------------------------------------- */
194+
initializeTimer();
195+
196+
if (ni) {
197+
ni->config(local_ip, gateway, subnet);
198+
} else {
199+
ni = CLwipIf::getInstance().get(NI_ETHERNET, local_ip, gateway, subnet);
200+
if (!ni) return 0;
201+
}
202+
203+
ni->DhcpNotUsed();
204+
CLwipIf::getInstance().addDns(dns_server);
205+
return 1;
206+
}
207+
208208
CEthernet Ethernet;

0 commit comments

Comments
 (0)