From b5f8cf0f036f2ece9b567c5406afb8f3da6ab7df Mon Sep 17 00:00:00 2001 From: Fabiano Kovalski Date: Wed, 6 Dec 2017 00:54:59 -0500 Subject: [PATCH] driver(i2c): corrected timeout range for i2c_set_timeout. Merges https://github.com/espressif/esp-idf/pull/1353 --- components/driver/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/driver/i2c.c b/components/driver/i2c.c index 6c9d4fed1..2028b8b35 100644 --- a/components/driver/i2c.c +++ b/components/driver/i2c.c @@ -729,7 +729,7 @@ esp_err_t i2c_get_data_timing(i2c_port_t i2c_num, int* sample_time, int* hold_ti esp_err_t i2c_set_timeout(i2c_port_t i2c_num, int timeout) { I2C_CHECK(i2c_num < I2C_NUM_MAX, I2C_NUM_ERROR_STR, ESP_ERR_INVALID_ARG); - I2C_CHECK((timeout <= I2C_SDA_SAMPLE_TIME_V) && (timeout > 0), I2C_TIMEING_VAL_ERR_STR, ESP_ERR_INVALID_ARG); + I2C_CHECK((timeout <= I2C_TIME_OUT_REG_V) && (timeout > 0), I2C_TIMEING_VAL_ERR_STR, ESP_ERR_INVALID_ARG); I2C_ENTER_CRITICAL(&i2c_spinlock[i2c_num]); I2C[i2c_num]->timeout.tout = timeout;