Slave Wire: fix TwoWire::onService() to handle repeated start
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
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?
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).