We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f6d8aa8 commit 582d033Copy full SHA for 582d033
libraries/Wire/Wire.cpp
@@ -110,11 +110,9 @@ uint8_t TwoWire::endTransmission(uint8_t sendStop)
110
if (txBufferLength >= 1) {
111
err = i2c_writebytes(txBuffer, txBufferLength, !sendStop);
112
} else {
113
- /* FIXME: A zero byte transmit is typically used to check for an
114
- * ACK from the slave device. This is currently not supported by
115
- * this library implementation
116
- */
117
- return 4; // Other error
+ //Workaround: I2C bus scan is currently implemented by sending an extra byte of value 0
+ txBuffer[0] = 0;
+ err = i2c_writebytes(txBuffer, 1, !sendStop);
118
}
119
// empty buffer
120
txBufferLength = 0;
0 commit comments