Skip to content

Commit

Permalink
Fixed network startup on MB6HC
Browse files Browse the repository at this point in the history
  • Loading branch information
dc42 committed Feb 8, 2022
1 parent 97afd19 commit c7cf6d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Networking/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,12 @@ Network::Network(Platform& p) noexcept : platform(p)
#endif
{
#if HAS_NETWORKING
#if defined(DUET3_V03)
#if defined(DUET3_MB6HC) || defined(DUET3_MB6XD)
interfaces[0] = new LwipEthernetInterface(p);
interfaces[1] = new WiFiInterface(p);
#elif defined(DUET3_MB6HC) || defined(DUET3_MB6XD)
interfaces[0] = new LwipEthernetInterface(p);
#elif defined(DUET_NG) || defined(DUET3MINI)
#elif defined(DUET_NG) || defined(DUET3MINI_V04)
interfaces[0] = nullptr; // we set this up in Init()
#elif defined(DUET3MINI4)
interfaces[0] = new WiFiInterface(p);
#elif defined(DUET_M)
interfaces[0] = new W5500Interface(p);
#elif defined(__LPC17xx__)
Expand All @@ -101,7 +100,7 @@ Network::Network(Platform& p) noexcept : platform(p)
#else
# error Unknown board
#endif
#endif // HAS_NETWORK
#endif // HAS_NETWORKING
}

#if SUPPORT_OBJECT_MODEL
Expand Down Expand Up @@ -176,7 +175,7 @@ void Network::Init() noexcept
# endif
# endif

# if defined(DUET3MINI)
# if defined(DUET3MINI_V04)
# if HAS_WIFI_NETWORKING && HAS_LWIP_NETWORKING
interfaces[0] = (platform.IsDuetWiFi()) ? static_cast<NetworkInterface*>(new WiFiInterface(platform)) : static_cast<NetworkInterface*>(new LwipEthernetInterface(platform));
# elif HAS_WIFI_NETWORKING
Expand Down
4 changes: 4 additions & 0 deletions src/Platform/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ Platform::Platform() noexcept :
// Initialise the Platform. Note: this is the first module to be initialised, so don't call other modules from here!
void Platform::Init() noexcept
{
#if HAS_LWIP_NETWORKING
pinMode(EthernetPhyResetPin, OUTPUT_LOW); // reset the Ethernet Phy chip
#endif

// Make sure the on-board drivers are disabled
#if defined(DUET_NG) || defined(PCCB_10)
pinMode(GlobalTmc2660EnablePin, OUTPUT_HIGH);
Expand Down

0 comments on commit c7cf6d7

Please sign in to comment.