Skip to content

Commit 539d9fe

Browse files
committed
Ajust code for ethernet
Bump version
1 parent fe23f0c commit 539d9fe

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

esp3d/src/modules/ethernet/ethconfig.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,11 @@ bool EthConfig::begin(int8_t& espMode) {
113113
esp3d_log("ETH spi PHY Type %d", ESP3D_ETH_PHY_TYPE);
114114
ETH_SPI.begin(ETH_SPI_SCK, ETH_SPI_MISO, ETH_SPI_MOSI);
115115
_started = ETH.begin(ETH_PHY_W5500, ESP3D_ETH_PHY_ADDR, ETH_PHY_CS,
116-
ETH_PHY_IRQ, ETH_PHY_RST, ETH_SPI);
117-
118-
116+
ETH_PHY_IRQ, ETH_PHY_RST, ETH_SPI);
119117
#endif // ESP3D_ETH_PHY_TYPE == TYPE_ETH_PHY_W5500
120118

121119
if (_started) {
120+
esp3d_log("Starting ethernet success");
122121
if (ESP3DSettings::isVerboseBoot()) {
123122
esp3d_commands.dispatch("Starting ethernet", ESP3DClientType::all_clients,
124123
no_id, ESP3DMessageType::unique,
@@ -131,31 +130,37 @@ bool EthConfig::begin(int8_t& espMode) {
131130
ESP3DClientType::all_clients, no_id,
132131
ESP3DMessageType::unique, ESP3DClientType::system,
133132
ESP3DAuthenticationLevel::admin);
133+
esp3d_log("Failed starting ethernet failed");
134+
return false;
134135
}
135136
ETH.setHostname(NetConfig::hostname(true));
136-
137137
// DHCP is only for Client
138138
if (espMode == ESP_ETH_STA) {
139139
if (!StartSTA()) {
140140
if (ESP3DSettings::isVerboseBoot()) {
141+
esp3d_log("Starting fallback mode");
141142
esp3d_commands.dispatch(
142143
"Starting fallback mode", ESP3DClientType::all_clients, no_id,
143144
ESP3DMessageType::unique, ESP3DClientType::system,
144145
ESP3DAuthenticationLevel::admin);
145146
}
146147
espMode = ESP3DSettings::readByte(ESP_ETH_STA_FALLBACK_MODE);
147-
res = true;
148+
res = false;
149+
return res;
148150
} else {
151+
esp3d_log("Client started");
149152
if (ESP3DSettings::isVerboseBoot()) {
150153
esp3d_commands.dispatch("Client started", ESP3DClientType::all_clients,
151154
no_id, ESP3DMessageType::unique,
152155
ESP3DClientType::system,
153156
ESP3DAuthenticationLevel::admin);
154157
}
158+
res = true;
155159
}
156160
}
157161
// Static IP or DHCP client ?
158162
if ((ESP3DSettings::readByte(ESP_ETH_STA_IP_MODE) != DHCP_MODE)) {
163+
esp3d_log("Show IP");
159164
esp3d_commands.dispatch(ETH.localIP().toString().c_str(),
160165
ESP3DClientType::all_clients, no_id,
161166
ESP3DMessageType::unique, ESP3DClientType::system,

info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "3.0.0.a244"
2+
"version": "3.0.0.a246"
33
}

0 commit comments

Comments
 (0)