STM32 Fix i2c_compute_timing() API

pull/14915/head
pennam 2021-07-12 22:10:50 +02:00
parent 0ea3f0cc53
commit ccf8995858
1 changed files with 3 additions and 0 deletions

View File

@ -1733,6 +1733,9 @@ uint32_t i2c_compute_timing(uint32_t clock_src_freq, uint32_t i2c_freq)
uint32_t speed;
uint32_t idx;
/* Reset valid timing count at the beginning of each new computation */
I2c_valid_timing_nbr = 0;
if ((clock_src_freq != 0U) && (i2c_freq != 0U)) {
for (speed = 0 ; speed <= (uint32_t)I2C_SPEED_FREQ_FAST_PLUS ; speed++) {
if ((i2c_freq >= I2C_Charac[speed].freq_min) &&