mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-29 18:27:20 +02:00
fix(i2c_master): Fix the stretch happen cause timeout in probe,
Closes https://github.com/espressif/esp-idf/issues/15589
This commit is contained in:
@ -1214,6 +1214,8 @@ esp_err_t i2c_master_probe(i2c_master_bus_handle_t bus_handle, uint16_t address,
|
||||
}
|
||||
i2c_ll_master_set_fractional_divider(hal->dev, 0, 0);
|
||||
i2c_ll_enable_intr_mask(hal->dev, I2C_LL_MASTER_EVENT_INTR);
|
||||
// 20ms is sufficient for stretch, since there is no device config on probe operation.
|
||||
i2c_hal_master_set_scl_timeout_val(hal, 20 * 1000, bus_handle->base->clk_src_freq_hz);
|
||||
i2c_ll_update(hal->dev);
|
||||
|
||||
s_i2c_send_commands(bus_handle, ticks_to_wait);
|
||||
|
@ -290,7 +290,6 @@ static esp_err_t i2c_slave_bus_destroy(i2c_slave_dev_handle_t i2c_slave)
|
||||
if (i2c_slave) {
|
||||
if (i2c_slave->base) {
|
||||
i2c_ll_disable_intr_mask(i2c_slave->base->hal.dev, I2C_LL_SLAVE_EVENT_INTR);
|
||||
i2c_common_deinit_pins(i2c_slave->base);
|
||||
i2c_release_bus_handle(i2c_slave->base);
|
||||
}
|
||||
if (i2c_slave->slv_rx_mux) {
|
||||
|
Reference in New Issue
Block a user