@@ -149,6 +149,9 @@ bool ETHClass::begin(eth_phy_type_t type, uint8_t phy_addr, int mdc, int mdio, i
149
149
case ETH_PHY_DP83848:
150
150
phy = esp_eth_phy_new_dp83848 (&phy_config);
151
151
break ;
152
+ case ETH_PHY_JL1101:
153
+ phy = esp_eth_phy_new_jl1101 (&phy_config);
154
+ break ;
152
155
case ETH_PHY_KSZ8041:
153
156
phy = esp_eth_phy_new_ksz80xx (&phy_config);
154
157
break ;
@@ -351,7 +354,7 @@ bool ETHClass::beginSPI(eth_phy_type_t type, uint8_t phy_addr, int cs, int irq,
351
354
log_w (" ETH Already Started" );
352
355
return true ;
353
356
}
354
- if (cs < 0 || irq < 0 ){
357
+ if (cs < 0 /* || irq < 0*/ ){
355
358
log_e (" CS and IRQ pins must be defined!" );
356
359
return false ;
357
360
}
@@ -447,6 +450,9 @@ bool ETHClass::beginSPI(eth_phy_type_t type, uint8_t phy_addr, int cs, int irq,
447
450
if (type == ETH_PHY_W5500){
448
451
eth_w5500_config_t mac_config = ETH_W5500_DEFAULT_CONFIG (spi_host, &spi_devcfg);
449
452
mac_config.int_gpio_num = _pin_irq;
453
+ if (_pin_irq < 0 ) {
454
+ mac_config.poll_period_ms = 10 ;
455
+ }
450
456
#if ETH_SPI_SUPPORTS_CUSTOM
451
457
if (_spi != NULL ){
452
458
mac_config.custom_spi_driver .config = this ;
@@ -586,8 +592,9 @@ bool ETHClass::beginSPI(eth_phy_type_t type, uint8_t phy_addr, int cs, int irq,
586
592
#if ETH_SPI_SUPPORTS_CUSTOM
587
593
}
588
594
#endif
589
- if (!perimanSetPinBus (_pin_irq, ESP32_BUS_TYPE_ETHERNET_SPI, (void *)(this ), -1 , -1 )){ goto err; }
590
-
595
+ if (_pin_irq != -1 ){
596
+ if (!perimanSetPinBus (_pin_irq, ESP32_BUS_TYPE_ETHERNET_SPI, (void *)(this ), -1 , -1 )){ goto err; }
597
+ }
591
598
if (_pin_sck != -1 ){
592
599
if (!perimanSetPinBus (_pin_sck, ESP32_BUS_TYPE_ETHERNET_SPI, (void *)(this ), -1 , -1 )){ goto err; }
593
600
}
0 commit comments