Double I2C read in one transaction skips a clock pulse (#5528) (#6654)
Double I2C read in one transaction skips a clock pulse (#5528) (#6654)

* Double I2C read in one transaction skips a clock pulse (#5528)

See https://github.com/esp8266/Arduino/issues/5528  and the more elaborate [description](https://github.com/maarten-pennings/I2C-tool/blob/master/I2Ctest8266/README.md#how-to-fix)
where @maarten-pennings did all the hard work, but as far as I could see, no PR was made.

I also noticed some code duplication, which I moved to separate functions.

According to [this documentation on I2C clock stretching](https://www.i2c-bus.org/clock-stretching/) it is not allowed to have some slave keep the clock low during transmission of a byte, only after an ack.
So that's why it is not done in the while loop.
But I wondered if there should be an extra delay between the sequence of pulses and the extra added clock "valley". See my comment in the code.

Fixes #5528

* [I2C] Restore clock stretch functionality during transfer

As requested here: https://github.com/esp8266/Arduino/pull/6654/files/8357a8c644244096cce1df30acd660c35d24a0e4#r339310509

* [I2C] Move duplicated clock stretch call to twi_scl_valley function

esp8266/Arduino,sticilface/Arduino,esp8266/Arduino,sticilface/Arduino,sticilface/Arduino,esp8266/Arduino,esp8266/Arduino,sticilface/Arduino,sticilface/Arduino,esp8266/Arduino