diff options
author | Etienne Carriere <etienne.carriere@linaro.org> | 2019-05-02 17:47:14 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2019-05-06 11:30:37 +0200 |
commit | ae49405bc6be80f85c182e48a03279f02544443a (patch) | |
tree | 734cd2feee7d4c25e06254cfe039f795c00f5dfb /core | |
parent | fee710d0eb6fe1ac8abe1ccae04f52a2edc6a185 (diff) |
stm32_i2c: correct timeout detection on transfer stop event
Fix timeout detection in i2c_wait_stop().
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/drivers/stm32_i2c.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/drivers/stm32_i2c.c b/core/drivers/stm32_i2c.c index 6bae2e6c..c15e4dd7 100644 --- a/core/drivers/stm32_i2c.c +++ b/core/drivers/stm32_i2c.c @@ -902,7 +902,7 @@ static int i2c_wait_txis(struct i2c_handle_s *hi2c, uint64_t timeout_ref) /* Wait STOPF bit is 1 in I2C_ISR register */ static int i2c_wait_stop(struct i2c_handle_s *hi2c, uint64_t timeout_ref) { - while (timeout_elapsed(timeout_ref)) { + while (!timeout_elapsed(timeout_ref)) { if (io_read32(get_base(hi2c) + I2C_ISR) & I2C_ISR_STOPF) break; |