Skip to content

Commit

Permalink
ci(pre-commit): Apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Oct 17, 2024
1 parent 8466e3e commit 9363ce8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 52 deletions.
2 changes: 1 addition & 1 deletion libraries/Ethernet/examples/ETH_LAN8720/ETH_LAN8720.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Important to be defined BEFORE including ETH.h for ETH.begin() to work.
// Example RMII LAN8720 (Olimex, etc.)
#ifndef ETH_PHY_MDC
#define ETH_PHY_TYPE ETH_PHY_LAN8720
#define ETH_PHY_TYPE ETH_PHY_LAN8720
#if CONFIG_IDF_TARGET_ESP32
#define ETH_PHY_ADDR 0
#define ETH_PHY_MDC 23
Expand Down
2 changes: 1 addition & 1 deletion libraries/Ethernet/examples/ETH_TLK110/ETH_TLK110.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <ETH.h>

#ifndef ETH_PHY_MDC
#define ETH_PHY_TYPE ETH_PHY_TLK110
#define ETH_PHY_TYPE ETH_PHY_TLK110
#if CONFIG_IDF_TARGET_ESP32
#define ETH_PHY_ADDR 31
#define ETH_PHY_MDC 23
Expand Down
54 changes: 15 additions & 39 deletions libraries/Ethernet/src/ETH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,45 +152,21 @@ void ETHClass::setTaskStackSize(size_t size) {
#if CONFIG_IDF_TARGET_ESP32
#define ETH_EMAC_DEFAULT_CONFIG() ETH_ESP32_EMAC_DEFAULT_CONFIG()
#elif CONFIG_IDF_TARGET_ESP32P4
#define ETH_EMAC_DEFAULT_CONFIG() \
{ \
.smi_gpio = \
{ \
.mdc_num = 31, \
.mdio_num = 52 \
}, \
.interface = EMAC_DATA_INTERFACE_RMII, \
.clock_config = \
{ \
.rmii = \
{ \
.clock_mode = EMAC_CLK_EXT_IN, \
.clock_gpio = (emac_rmii_clock_gpio_t) ETH_RMII_CLK \
} \
}, \
.dma_burst_len = ETH_DMA_BURST_LEN_32, \
.intr_priority = 0, \
.emac_dataif_gpio = \
{ \
.rmii = \
{ \
.tx_en_num = ETH_RMII_TX_EN, \
.txd0_num = ETH_RMII_TX0, \
.txd1_num = ETH_RMII_TX1, \
.crs_dv_num = ETH_RMII_CRS_DV, \
.rxd0_num = ETH_RMII_RX0, \
.rxd1_num = ETH_RMII_RX1_EN \
} \
}, \
.clock_config_out_in = \
{ \
.rmii = \
{ \
.clock_mode = EMAC_CLK_EXT_IN, \
.clock_gpio = (emac_rmii_clock_gpio_t) -1 \
} \
}, \
}
#define ETH_EMAC_DEFAULT_CONFIG() \
{ \
.smi_gpio = {.mdc_num = 31, .mdio_num = 52}, .interface = EMAC_DATA_INTERFACE_RMII, \
.clock_config = {.rmii = {.clock_mode = EMAC_CLK_EXT_IN, .clock_gpio = (emac_rmii_clock_gpio_t)ETH_RMII_CLK}}, .dma_burst_len = ETH_DMA_BURST_LEN_32, \
.intr_priority = 0, \
.emac_dataif_gpio = \
{.rmii = \
{.tx_en_num = ETH_RMII_TX_EN, \
.txd0_num = ETH_RMII_TX0, \
.txd1_num = ETH_RMII_TX1, \
.crs_dv_num = ETH_RMII_CRS_DV, \
.rxd0_num = ETH_RMII_RX0, \
.rxd1_num = ETH_RMII_RX1_EN}}, \
.clock_config_out_in = {.rmii = {.clock_mode = EMAC_CLK_EXT_IN, .clock_gpio = (emac_rmii_clock_gpio_t) - 1}}, \
}
#endif

bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, int power, eth_clock_mode_t clock_mode) {
Expand Down
10 changes: 5 additions & 5 deletions libraries/Ethernet/src/ETH.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ typedef enum {
typedef emac_rmii_clock_mode_t eth_clock_mode_t;
#include "pins_arduino.h"
#ifndef ETH_RMII_TX_EN
#define ETH_RMII_TX_EN 49
#define ETH_RMII_TX_EN 49
#endif
#ifndef ETH_RMII_TX0
#define ETH_RMII_TX0 34
#define ETH_RMII_TX0 34
#endif
#ifndef ETH_RMII_TX1
#define ETH_RMII_TX1 35
#define ETH_RMII_TX1 35
#endif
#ifndef ETH_RMII_RX0
#define ETH_RMII_RX0 29
#define ETH_RMII_RX0 29
#endif
#ifndef ETH_RMII_RX1_EN
#define ETH_RMII_RX1_EN 30
Expand All @@ -111,7 +111,7 @@ typedef emac_rmii_clock_mode_t eth_clock_mode_t;
#define ETH_RMII_CRS_DV 28
#endif
#ifndef ETH_RMII_CLK
#define ETH_RMII_CLK 50
#define ETH_RMII_CLK 50
#endif
#endif
#endif /* CONFIG_ETH_USE_ESP32_EMAC */
Expand Down
12 changes: 6 additions & 6 deletions variants/esp32p4/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ static const uint8_t T11 = 13;
static const uint8_t T12 = 14;
static const uint8_t T13 = 15;

#define ETH_PHY_TYPE ETH_PHY_TLK110
#define ETH_PHY_ADDR 1
#define ETH_PHY_MDC 31
#define ETH_PHY_MDIO 52
#define ETH_PHY_POWER 51
#define ETH_PHY_TYPE ETH_PHY_TLK110
#define ETH_PHY_ADDR 1
#define ETH_PHY_MDC 31
#define ETH_PHY_MDIO 52
#define ETH_PHY_POWER 51
#define ETH_RMII_TX_EN 49
#define ETH_RMII_TX0 34
#define ETH_RMII_TX1 35
#define ETH_RMII_RX0 29
#define ETH_RMII_RX1_EN 30
#define ETH_RMII_CRS_DV 28
#define ETH_RMII_CLK 50
#define ETH_CLK_MODE EMAC_CLK_EXT_IN
#define ETH_CLK_MODE EMAC_CLK_EXT_IN

#endif /* Pins_Arduino_h */

0 comments on commit 9363ce8

Please sign in to comment.