Skip to content

Commit 9de9b63

Browse files
authored
Update ETH.cpp
1 parent 3a597d8 commit 9de9b63

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: libraries/Ethernet/src/ETH.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void ETHClass::_onEthEvent(int32_t event_id, void *event_data) {
118118
}
119119

120120
ETHClass::ETHClass(uint8_t eth_index)
121-
: _eth_handle(NULL), _eth_index(eth_index), _phy_type(ETH_PHY_MAX)
121+
: _eth_handle(NULL), _eth_index(eth_index), _phy_type(ETH_PHY_MAX), _glue_handle(NULL)
122122
#if ETH_SPI_SUPPORTS_CUSTOM
123123
,
124124
_spi(NULL)
@@ -729,7 +729,7 @@ bool ETHClass::beginSPI(
729729
log_e("event_handler_instance_register for ETH_EVENT Failed!");
730730
return false;
731731
}
732-
732+
733733
/* attach to receive events */
734734
initNetif((Network_Interface_ID)(ESP_NETIF_ID_ETH + _eth_index));
735735

@@ -833,6 +833,7 @@ void ETHClass::end(void) {
833833
log_e("Failed to del_netif_glue Ethernet");
834834
return;
835835
}
836+
_glue_handle = NULL;
836837
}
837838
//uninstall driver
838839
if (esp_eth_driver_uninstall(_eth_handle) != ESP_OK) {

0 commit comments

Comments
 (0)