diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp index 3acea70ac58..ab8a71e313d 100644 --- a/libraries/Wire/src/Wire.cpp +++ b/libraries/Wire/src/Wire.cpp @@ -191,8 +191,14 @@ uint8_t TwoWire::endTransmission(bool sendStop) // Assumes Wire.beginTransactio return (last_error == I2C_ERROR_CONTINUE)?I2C_ERROR_OK:last_error; // Don't return Continue for compatibility. } -/* @stickBreaker 11/2017 fix for ReSTART timeout, ISR - */ +/* Added to match the Arduino function definition: https://github.com/arduino/ArduinoCore-API/blob/173e8eadced2ad32eeb93bcbd5c49f8d6a055ea6/api/HardwareI2C.h#L39 + * See: https://github.com/arduino-libraries/ArduinoECCX08/issues/25 +*/ +size_t requestFrom(uint8_t address, size_t len, bool stopBit) +{ + return requestFrom(address, (uint8_t)len, stopBit); +} + uint8_t TwoWire::requestFrom(uint16_t address, uint8_t size, bool sendStop) { //use internal Wire rxBuffer, multiple requestFrom()'s may be pending, try to share rxBuffer diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h index 3cee73104bd..af66d361845 100644 --- a/libraries/Wire/src/Wire.h +++ b/libraries/Wire/src/Wire.h @@ -101,6 +101,7 @@ class TwoWire: public Stream uint8_t requestFrom(uint16_t address, uint8_t size); uint8_t requestFrom(uint8_t address, uint8_t size, uint8_t sendStop); uint8_t requestFrom(uint8_t address, uint8_t size); + size_t requestFrom(uint8_t address, size_t len, bool stopBit); uint8_t requestFrom(int address, int size, int sendStop); uint8_t requestFrom(int address, int size);