From 01c254d76b7d811681b94d7928f77b9f8fbcb64e Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Tue, 7 Jun 2022 04:37:22 +0300 Subject: [PATCH] Fix fail to set single byte that contains the slave address Checking here really does not work when called from within `onRequest` --- cores/esp32/esp32-hal-i2c-slave.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/cores/esp32/esp32-hal-i2c-slave.c b/cores/esp32/esp32-hal-i2c-slave.c index 4d67eaff0e3..16dc050e58d 100644 --- a/cores/esp32/esp32-hal-i2c-slave.c +++ b/cores/esp32/esp32-hal-i2c-slave.c @@ -390,18 +390,6 @@ size_t i2cSlaveWrite(uint8_t num, const uint8_t *buf, uint32_t len, uint32_t tim } I2C_SLAVE_MUTEX_LOCK(); #if CONFIG_IDF_TARGET_ESP32 - //make sure that tx is idle - uint64_t tout_at = esp_timer_get_time() + (timeout_ms * 1000); - while(i2c_ll_slave_addressed(i2c->dev) && i2c_ll_slave_rw(i2c->dev)) { - // ongoing MASTER READ - //wait up to timeout_ms for current transaction to finish - vTaskDelay(2); - if((uint64_t)esp_timer_get_time() >= tout_at){ - log_e("TX IDLE WAIT TIMEOUT!"); - I2C_SLAVE_MUTEX_UNLOCK(); - return 0; - } - } i2c_ll_slave_disable_tx_it(i2c->dev); if (i2c_ll_get_txfifo_len(i2c->dev) < SOC_I2C_FIFO_LEN) { i2c_ll_txfifo_rst(i2c->dev);