Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Networking/Network.cpp')
-rw-r--r--src/Networking/Network.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Networking/Network.cpp b/src/Networking/Network.cpp
index 91193ca5..e7140eb3 100644
--- a/src/Networking/Network.cpp
+++ b/src/Networking/Network.cpp
@@ -186,10 +186,8 @@ void Network::Init() noexcept
SafeStrncpy(hostname, DEFAULT_HOSTNAME, ARRAY_SIZE(hostname));
- for (NetworkInterface *iface : interfaces)
- {
- iface->Init();
- }
+ // Only the MB6HC has more than one interface, and at this point we haven't created the second one yet. So initialise just the first.
+ interfaces[0]->Init();
#endif
fastLoop = UINT32_MAX;
@@ -205,6 +203,8 @@ void Network::CreateAdditionalInterface() noexcept
{
interfaces[1] = new WiFiInterface(platform);
numActualNetworkInterfaces = 2;
+ interfaces[1]->Init();
+ interfaces[1]->UpdateHostname(hostname);
}
}
@@ -695,9 +695,9 @@ void Network::SetHostname(const char *name) noexcept
strcpy(hostname, DEFAULT_HOSTNAME);
}
- for (NetworkInterface *iface : interfaces)
+ for (unsigned int i = 0; i < GetNumNetworkInterfaces(); ++i)
{
- iface->UpdateHostname(hostname);
+ interfaces[i]->UpdateHostname(hostname);
}
#endif
}