From 5c310a0bd165b79d626dd86670d296b9a33573cd Mon Sep 17 00:00:00 2001 From: Bogdan Kolendovskyy Date: Mon, 6 Jan 2025 11:37:12 +0100 Subject: [PATCH] Minor corrections --- ksz8863/examples/simple_switch/main/simple_switch_main.c | 1 - ksz8863/examples/switch_mode/main/switch_main.c | 1 - ksz8863/examples/two_ports_mode/main/two_ports_main.c | 1 - ksz8863/src/ksz8863_ctrl.c | 4 +--- 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ksz8863/examples/simple_switch/main/simple_switch_main.c b/ksz8863/examples/simple_switch/main/simple_switch_main.c index 4c09af3..025ec2f 100644 --- a/ksz8863/examples/simple_switch/main/simple_switch_main.c +++ b/ksz8863/examples/simple_switch/main/simple_switch_main.c @@ -194,7 +194,6 @@ esp_err_t ksz8863_board_specific_init(esp_eth_handle_t eth_handle) .scl_io_num = CONFIG_EXAMPLE_I2C_SCL_GPIO, .sda_io_num = CONFIG_EXAMPLE_I2C_SDA_GPIO, .glitch_ignore_cnt = 7, - .flags.enable_internal_pullup = true }; i2c_master_bus_handle_t bus_handle; ESP_GOTO_ON_ERROR(i2c_new_master_bus(&i2c_mst_config, &bus_handle), err, TAG, "I2C initialization failed"); diff --git a/ksz8863/examples/switch_mode/main/switch_main.c b/ksz8863/examples/switch_mode/main/switch_main.c index e70ca9d..a6ae36b 100644 --- a/ksz8863/examples/switch_mode/main/switch_main.c +++ b/ksz8863/examples/switch_mode/main/switch_main.c @@ -233,7 +233,6 @@ esp_err_t ksz8863_board_specific_init(esp_eth_handle_t eth_handle) .scl_io_num = CONFIG_EXAMPLE_I2C_SCL_GPIO, .sda_io_num = CONFIG_EXAMPLE_I2C_SDA_GPIO, .glitch_ignore_cnt = 7, - .flags.enable_internal_pullup = true }; i2c_master_bus_handle_t bus_handle; ESP_GOTO_ON_ERROR(i2c_new_master_bus(&i2c_mst_config, &bus_handle), err, TAG, "I2C initialization failed"); diff --git a/ksz8863/examples/two_ports_mode/main/two_ports_main.c b/ksz8863/examples/two_ports_mode/main/two_ports_main.c index 9d93e69..e8e7023 100644 --- a/ksz8863/examples/two_ports_mode/main/two_ports_main.c +++ b/ksz8863/examples/two_ports_mode/main/two_ports_main.c @@ -226,7 +226,6 @@ esp_err_t ksz8863_board_specific_init(esp_eth_handle_t eth_handle) .scl_io_num = CONFIG_EXAMPLE_I2C_SCL_GPIO, .sda_io_num = CONFIG_EXAMPLE_I2C_SDA_GPIO, .glitch_ignore_cnt = 7, - .flags.enable_internal_pullup = true }; i2c_master_bus_handle_t bus_handle; ESP_GOTO_ON_ERROR(i2c_new_master_bus(&i2c_mst_config, &bus_handle), err, TAG, "I2C initialization failed"); diff --git a/ksz8863/src/ksz8863_ctrl.c b/ksz8863/src/ksz8863_ctrl.c index ea316df..f0c0e06 100644 --- a/ksz8863/src/ksz8863_ctrl.c +++ b/ksz8863/src/ksz8863_ctrl.c @@ -53,7 +53,7 @@ static esp_err_t ksz8863_i2c_write(uint8_t reg_addr, uint8_t *data, size_t len) memcpy(reg_addr_and_data + 1, data, len); // When performing a soft reset, the KSZ8863 doesn't produce an ACK. Print a warning that the error is expected and ignore it. if unlikely(reg_addr == KSZ8863_RESET_ADDR) { - ESP_LOGW(TAG, "Ignore the error below. It is produced by the I2C driver because KSZ8863 does not produce ACK when performing soft reset. It is epxected behaviour and requires no actions on your side."); + ESP_LOGW(TAG, "The following I2C error can be ignored. It is thrown by the I2C driver because KSZ8863 does not produce ACK when performing soft reset. It is expected behaviour and requires no actions on your side."); i2c_master_transmit(s_ksz8863_ctrl_intf->i2c_handle, reg_addr_and_data, len + 1, KSZ8863_I2C_TIMEOUT_MS); } else { ESP_GOTO_ON_ERROR(i2c_master_transmit(s_ksz8863_ctrl_intf->i2c_handle, reg_addr_and_data, len + 1, KSZ8863_I2C_TIMEOUT_MS), err, TAG, "Error during i2c write operation"); @@ -278,7 +278,6 @@ esp_err_t ksz8863_ctrl_intf_init(ksz8863_ctrl_intf_config_t *config) s_ksz8863_ctrl_intf->ksz8863_reg_read = ksz8863_spi_read; s_ksz8863_ctrl_intf->ksz8863_reg_write = ksz8863_spi_write; - case KSZ8863_SMI_MODE: default: break; } @@ -298,7 +297,6 @@ esp_err_t ksz8863_ctrl_intf_deinit(void) case KSZ8863_SPI_MODE: vSemaphoreDelete(s_ksz8863_ctrl_intf->bus_lock); spi_bus_remove_device(s_ksz8863_ctrl_intf->spi_handle); - case KSZ8863_SMI_MODE: default: break; }