From 9363ce883888ade63044dc55323bfe139c4dc9f1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 11:20:12 +0000 Subject: [PATCH] ci(pre-commit): Apply automatic fixes --- .../examples/ETH_LAN8720/ETH_LAN8720.ino | 2 +- .../examples/ETH_TLK110/ETH_TLK110.ino | 2 +- libraries/Ethernet/src/ETH.cpp | 54 ++++++------------- libraries/Ethernet/src/ETH.h | 10 ++-- variants/esp32p4/pins_arduino.h | 12 ++--- 5 files changed, 28 insertions(+), 52 deletions(-) diff --git a/libraries/Ethernet/examples/ETH_LAN8720/ETH_LAN8720.ino b/libraries/Ethernet/examples/ETH_LAN8720/ETH_LAN8720.ino index efa1005824a..59a32750bf6 100644 --- a/libraries/Ethernet/examples/ETH_LAN8720/ETH_LAN8720.ino +++ b/libraries/Ethernet/examples/ETH_LAN8720/ETH_LAN8720.ino @@ -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 diff --git a/libraries/Ethernet/examples/ETH_TLK110/ETH_TLK110.ino b/libraries/Ethernet/examples/ETH_TLK110/ETH_TLK110.ino index c27daffa89b..242281c3997 100644 --- a/libraries/Ethernet/examples/ETH_TLK110/ETH_TLK110.ino +++ b/libraries/Ethernet/examples/ETH_TLK110/ETH_TLK110.ino @@ -6,7 +6,7 @@ #include #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 diff --git a/libraries/Ethernet/src/ETH.cpp b/libraries/Ethernet/src/ETH.cpp index 025479d18b4..4ef184ac97a 100644 --- a/libraries/Ethernet/src/ETH.cpp +++ b/libraries/Ethernet/src/ETH.cpp @@ -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) { diff --git a/libraries/Ethernet/src/ETH.h b/libraries/Ethernet/src/ETH.h index 221289bc7ac..10d6b504c2a 100644 --- a/libraries/Ethernet/src/ETH.h +++ b/libraries/Ethernet/src/ETH.h @@ -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 @@ -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 */ diff --git a/variants/esp32p4/pins_arduino.h b/variants/esp32p4/pins_arduino.h index 063ed5236dc..980e7bdb527 100644 --- a/variants/esp32p4/pins_arduino.h +++ b/variants/esp32p4/pins_arduino.h @@ -57,11 +57,11 @@ 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 @@ -69,6 +69,6 @@ static const uint8_t T13 = 15; #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 */