Unverified Commit 99520f66 authored by Me No Dev's avatar Me No Dev Committed by GitHub

Fix fail to set single byte that contains the slave address (#6840)

Checking here really does not work when called from within `onRequest`
parent 33011ede
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment