Skip to content

Commit

Permalink
Minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdankolendovskyy committed Jan 6, 2025
1 parent dd0d710 commit 5c310a0
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion ksz8863/examples/simple_switch/main/simple_switch_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 0 additions & 1 deletion ksz8863/examples/switch_mode/main/switch_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 0 additions & 1 deletion ksz8863/examples/two_ports_mode/main/two_ports_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 1 addition & 3 deletions ksz8863/src/ksz8863_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 5c310a0

Please sign in to comment.