Skip to content

Commit 668c381

Browse files
committed
Wire: wait while bus is busy if ack failed
1 parent b86fb30 commit 668c381

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: cores/esp32/esp32-hal-i2c.c

+1
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ i2c_err_t i2cWrite(i2c_t * i2c, uint16_t address, bool addr_10bit, uint8_t * dat
219219
//Transmission did not finish and ACK_ERR is set
220220
if(i2c->dev->int_raw.ack_err) {
221221
//log_w("Ack Error! Addr: %x", address >> 1);
222+
while(i2c->dev->status_reg.bus_busy);
222223
I2C_MUTEX_UNLOCK();
223224
return I2C_ERROR_ACK;
224225
}

0 commit comments

Comments
 (0)