Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f7b4959

Browse filesBrowse files
authored
fix(ethernet): move event listener earlier to avoid missing event ETH_CONNECTED (espressif#9481)
* Ethernet: Move event listener earlier * fix(ethernet): move network listener after initNetif
1 parent 8c75c35 commit f7b4959
Copy full SHA for f7b4959

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎libraries/Ethernet/src/ETH.cpp

Copy file name to clipboardExpand all lines: libraries/Ethernet/src/ETH.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i
287287
/* attach to receive events */
288288
initNetif((Network_Interface_ID)(ESP_NETIF_ID_ETH+_eth_index));
289289

290+
Network.onSysEvent(onEthConnected, ARDUINO_EVENT_ETH_CONNECTED);
291+
290292
ret = esp_eth_start(_eth_handle);
291293
if(ret != ESP_OK){
292294
log_e("esp_eth_start failed: %d", ret);
@@ -308,8 +310,6 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i
308310
if(!perimanSetPinBus(_pin_power, ESP32_BUS_TYPE_ETHERNET_PWR, (void *)(this), -1, -1)){ goto err; }
309311
}
310312

311-
Network.onSysEvent(onEthConnected, ARDUINO_EVENT_ETH_CONNECTED);
312-
313313
// holds a few milliseconds to let DHCP start and enter into a good state
314314
// FIX ME -- adresses issue https://github.com/espressif/arduino-esp32/issues/5733
315315
delay(50);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.