Skip to content

Commit d5b0520

Browse files
committed
Merge branch 'fix/i2c_stretch_probe' into 'master'
fix(i2c_master): Fix the stretch happen cause timeout in probe Closes IDFGH-14869 See merge request espressif/esp-idf!37975
2 parents 21ca237 + 43e83b8 commit d5b0520

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

components/esp_driver_i2c/i2c_master.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,8 @@ esp_err_t i2c_master_probe(i2c_master_bus_handle_t bus_handle, uint16_t address,
12851285
}
12861286
i2c_ll_master_set_fractional_divider(hal->dev, 0, 0);
12871287
i2c_ll_enable_intr_mask(hal->dev, I2C_LL_MASTER_EVENT_INTR);
1288+
// 20ms is sufficient for stretch, since there is no device config on probe operation.
1289+
i2c_hal_master_set_scl_timeout_val(hal, 20 * 1000, bus_handle->base->clk_src_freq_hz);
12881290
i2c_ll_update(hal->dev);
12891291

12901292
s_i2c_send_commands(bus_handle, ticks_to_wait);

0 commit comments

Comments
 (0)