mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-29 18:27:15 +02:00
Wire: wait while bus is busy if ack failed
This commit is contained in:
@ -219,6 +219,7 @@ i2c_err_t i2cWrite(i2c_t * i2c, uint16_t address, bool addr_10bit, uint8_t * dat
|
|||||||
//Transmission did not finish and ACK_ERR is set
|
//Transmission did not finish and ACK_ERR is set
|
||||||
if(i2c->dev->int_raw.ack_err) {
|
if(i2c->dev->int_raw.ack_err) {
|
||||||
//log_w("Ack Error! Addr: %x", address >> 1);
|
//log_w("Ack Error! Addr: %x", address >> 1);
|
||||||
|
while(i2c->dev->status_reg.bus_busy);
|
||||||
I2C_MUTEX_UNLOCK();
|
I2C_MUTEX_UNLOCK();
|
||||||
return I2C_ERROR_ACK;
|
return I2C_ERROR_ACK;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user