arduino/Arduino — comment on commit 7392f8514de9d68659c744fb956c089f7b3932ef
File:  line 0
By helenarobotics:

The above change does breaks repeated STARTS. Unfortunately, the original author change is completely un-necessary, and is supposed to ad support for clock-stretching.

Per the Atmel manual.
[...] the TWI will hold the SCL clock low during the wake up and until the TWINT Flag is cleared (by writing it to one). Further data reception will be carried out as normal, with the AVR clocks run-ning as normal. Observe that if the AVR is set up with a long start-up time, the SCL line may be held low for a long time, blocking other data transmissions.

One can infer that the SCL clock is held low until the TWINT flag is cleared, which occurs in the twi_releaseBus() method. This needs to occur after the callback has been completed.

Therefore, the need for the custom 'twi_stop_slv()' is not necessary, and in fact the routine is identical functionally to the twi_releaseBus() method. Removing lines 416/417 above is the correct fix. Without it, the Arduino will not respond correct to repeated start commands, which is the most common way of accessing I2C sensors (read data from a register, which is specified via a write followed directly by a red).