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:
authorDavid Crocker <dcrocker@eschertech.com>2022-09-19 17:45:12 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-09-23 15:45:06 +0300
commit052380267cdcb7b3a3c66c7f755159dba5d24baa (patch)
tree3965ec8ebaeacd37fc53d2eb13c2e4a86b432446
parent13376e04d1da83d2010a7728315e7d5b98bf1b52 (diff)
Fixed MB6HC network initialisation issues
-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
}