Skip to content

Commit

Permalink
Fix SPI for DM9051
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev committed Sep 6, 2023
1 parent c613d69 commit 3eaa825
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions libraries/Ethernet/src/ETH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ esp_err_t ETHClass::eth_spi_read(uint32_t cmd, uint32_t addr, void *data, uint32

#if CONFIG_ETH_SPI_ETHERNET_DM9051
if(_phy_type == ETH_PHY_DM9051){
_spi->write(cmd);
_spi->write(addr);
_spi->write(((cmd & 0x01) << 7) | (addr & 0x7F));
} else
#endif
#if CONFIG_ETH_SPI_ETHERNET_W5500
Expand Down Expand Up @@ -300,8 +299,7 @@ esp_err_t ETHClass::eth_spi_write(uint32_t cmd, uint32_t addr, const void *data,

#if CONFIG_ETH_SPI_ETHERNET_DM9051
if(_phy_type == ETH_PHY_DM9051){
_spi->write(cmd);
_spi->write(addr);
_spi->write(((cmd & 0x01) << 7) | (addr & 0x7F));
} else
#endif
#if CONFIG_ETH_SPI_ETHERNET_W5500
Expand Down

0 comments on commit 3eaa825

Please sign in to comment.