mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(i2c_master): Fix an I2C issue that slave streth happen but master timeout set seems doesn't work
Closes https://github.com/espressif/esp-idf/issues/14129 Closes https://github.com/espressif/esp-idf/issues/14401
This commit is contained in:
@@ -734,7 +734,7 @@ static inline void i2c_ll_master_get_filter(i2c_dev_t *hw, uint8_t *filter_conf)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reste I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
* @brief reset I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
@@ -972,7 +972,8 @@ static inline bool i2c_ll_master_is_cmd_done(i2c_dev_t *hw, int cmd_idx)
|
||||
static inline uint32_t i2c_ll_calculate_timeout_us_to_reg_val(uint32_t src_clk_hz, uint32_t timeout_us)
|
||||
{
|
||||
uint32_t clk_cycle_num_per_us = src_clk_hz / (1 * 1000 * 1000);
|
||||
return 31 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
// round up to an integer
|
||||
return 32 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////Deprecated Functions//////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user