Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions libraries/Ethernet/src/ETH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ bool ETHClass::beginSPI(eth_phy_type_t type, uint8_t phy_addr, int cs, int irq,
log_w("ETH Already Started");
return true;
}
if(cs < 0 || irq < 0){
if(cs < 0 /*|| irq < 0*/){
log_e("CS and IRQ pins must be defined!");
return false;
}
Expand Down Expand Up @@ -447,6 +447,9 @@ bool ETHClass::beginSPI(eth_phy_type_t type, uint8_t phy_addr, int cs, int irq,
if(type == ETH_PHY_W5500){
eth_w5500_config_t mac_config = ETH_W5500_DEFAULT_CONFIG(spi_host, &spi_devcfg);
mac_config.int_gpio_num = _pin_irq;
if (_pin_irq < 0) {
mac_config.poll_period_ms = 10;
}
#if ETH_SPI_SUPPORTS_CUSTOM
if(_spi != NULL){
mac_config.custom_spi_driver.config = this;
Expand Down Expand Up @@ -586,8 +589,9 @@ bool ETHClass::beginSPI(eth_phy_type_t type, uint8_t phy_addr, int cs, int irq,
#if ETH_SPI_SUPPORTS_CUSTOM
}
#endif
if(!perimanSetPinBus(_pin_irq, ESP32_BUS_TYPE_ETHERNET_SPI, (void *)(this), -1, -1)){ goto err; }

if(_pin_irq != -1){
if(!perimanSetPinBus(_pin_irq, ESP32_BUS_TYPE_ETHERNET_SPI, (void *)(this), -1, -1)){ goto err; }
}
if(_pin_sck != -1){
if(!perimanSetPinBus(_pin_sck, ESP32_BUS_TYPE_ETHERNET_SPI, (void *)(this), -1, -1)){ goto err; }
}
Expand Down