ArduinoCore-samd icon indicating copy to clipboard operation
ArduinoCore-samd copied to clipboard

Slave Wire: fix TwoWire::onService() to handle repeated start

Open reufer opened this issue 5 years ago • 3 comments

Combined I2C write/read transactions with repeated start conditions were not possible, since only onRequestCallback was called. Any previously received data was passed to onReceiveCallback as part of a subsequent master write.

reufer avatar Dec 25 '20 20:12 reufer

@reufer

I don't think this is quite right yet.The existing onService handler in Wire.cpp seems to have a couple of issues (onRequest and onReceive are backwards, and you have to do two writes to get them to the onReceive callback), and your changes don't fully address them. I've taken a pass at rewriting the whole function and I think I've got it working correctly, including handling repeated starts.

Since you've already take a shot at this, would you mind trying out the changes in #605?

stonehippo avatar Feb 22 '21 22:02 stonehippo

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 09 '21 13:04 CLAassistant

I've submitted #669, which replaces #605 (same code, just applied against current master and resubmitted since the earlier one got stalled due to #616).

stonehippo avatar Apr 19 '22 16:04 stonehippo