Skip to content

Commit 7cbfca7

Browse files
committed
Fix W55000 Comnpilation
1 parent aba6ecb commit 7cbfca7

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

esp3d/src/modules/ethernet/ethconfig.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@
3030
#include "../../core/esp3d_string.h"
3131
#include "../network/netconfig.h"
3232
#include "ethconfig.h"
33-
#ifdef ETHERNET_SPI_USE_SPI
34-
#define ETH_SPI SPI
35-
#endif // ETHERNET_SPI_USE_SPI
36-
#if ETHERNET_SPI_USE_SPI2
37-
#define ETH_SPI SPI2
38-
#endif // ETHERNET_SPI_USE_SPI2
39-
#ifndef ETH_SPI
40-
#define ETH_SPI SPI
41-
#endif // ETH_SPI
42-
#
4333

4434
#if defined(GCODE_HOST_FEATURE)
4535
#include "../gcode_host/gcode_host.h"
@@ -109,11 +99,20 @@ bool EthConfig::begin(int8_t& espMode) {
10999
// TYPE_ETH_PHY_RTL8201 || ESP3D_ETH_PHY_TYPE == TYPE_ETH_PHY_DP83848 ||
110100
// ESP3D_ETH_PHY_TYPE == TYPE_ETH_PHY_KSZ8041 || ESP3D_ETH_PHY_TYPE ==
111101
// TYPE_ETH_PHY_KSZ8081
102+
112103
#if ESP3D_ETH_PHY_TYPE == TYPE_ETH_PHY_W5500
113-
esp3d_log("ETH spi PHY Type %d", ESP3D_ETH_PHY_TYPE);
114-
ETH_SPI.begin(ETH_SPI_SCK, ETH_SPI_MISO, ETH_SPI_MOSI);
104+
#if defined(ETHERNET_SPI_USE_SPI) && (ETHERNET_SPI_USE_SPI == 1)
105+
esp3d_log("ETH spi PHY Type %d using SPI", ESP3D_ETH_PHY_TYPE);
106+
SPI.begin(ETH_SPI_SCK, ETH_SPI_MISO, ETH_SPI_MOSI);
107+
_started = ETH.begin(ETH_PHY_W5500, ESP3D_ETH_PHY_ADDR, ETH_PHY_CS,
108+
ETH_PHY_IRQ, ETH_PHY_RST, SPI);
109+
#endif // defined(ETHERNET_SPI_USE_SPI) && (ETHERNET_SPI_USE_SPI == 1)
110+
#if defined(ETHERNET_SPI_USE_SPI2) && (ETHERNET_SPI_USE_SPI2 == 1)
111+
esp3d_log("ETH spi PHY Type %d using SPI2", ESP3D_ETH_PHY_TYPE);
112+
115113
_started = ETH.begin(ETH_PHY_W5500, ESP3D_ETH_PHY_ADDR, ETH_PHY_CS,
116-
ETH_PHY_IRQ, ETH_PHY_RST, ETH_SPI);
114+
ETH_PHY_IRQ, ETH_PHY_RST, SPI3_HOST,ETH_SPI_SCK, ETH_SPI_MISO, ETH_SPI_MOSI);
115+
#endif // defined(ETHERNET_SPI_USE_SPI2) && (ETHERNET_SPI_USE_SPI2 == 1)
117116
#endif // ESP3D_ETH_PHY_TYPE == TYPE_ETH_PHY_W5500
118117

119118
if (_started) {

0 commit comments

Comments
 (0)