Wire buffer length improvments. by flaviut · Pull Request #8398 · esp8266/Arduino (original) (raw)

Enable I2C_BUFFER_LENGTH definition for Wire lib

Based on
paclema/arduino-esp32@375a89e

We should have been very careful when #defining things to not use a name
that could conflict with the user's own code, so this marks that old
define as deprecated.

If you opt-into the new behavior, you do not get the old BUFFER_LENGTH
constant.

Increase buffer indexing variable size

I looked over the users of these variables and they should be fine with
no additional changes. The existing methods already have an option to
use size_t rather than uint8_t.

There's a few methods which return int instead of size_t, which isn't
great from a portability perspective but will be fine since this only is
designed to run on the ESP8266.'

Fixes #8391


Feel free to use this patchset in full or in part.