diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp index 2568e3c9413..2bcd9bc2112 100644 --- a/libraries/Wire/src/Wire.cpp +++ b/libraries/Wire/src/Wire.cpp @@ -588,48 +588,48 @@ void TwoWire::flush(void) //i2cFlush(num); // cleanup } -size_t TwoWire::requestFrom(uint8_t address, size_t len, bool sendStop) -{ - return requestFrom(static_cast(address), static_cast(len), static_cast(sendStop)); -} - -uint8_t TwoWire::requestFrom(uint8_t address, uint8_t len, uint8_t sendStop) -{ - return requestFrom(static_cast(address), static_cast(len), static_cast(sendStop)); -} - -uint8_t TwoWire::requestFrom(uint16_t address, uint8_t len, uint8_t sendStop) -{ - return requestFrom(address, static_cast(len), static_cast(sendStop)); -} - -/* 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 -*/ -uint8_t TwoWire::requestFrom(uint16_t address, uint8_t len, bool stopBit) -{ - return requestFrom((uint16_t)address, (size_t)len, stopBit); -} - -uint8_t TwoWire::requestFrom(uint8_t address, uint8_t len) -{ - return requestFrom(static_cast(address), static_cast(len), true); -} - -uint8_t TwoWire::requestFrom(uint16_t address, uint8_t len) -{ - return requestFrom(address, static_cast(len), true); -} - -uint8_t TwoWire::requestFrom(int address, int len) -{ - return requestFrom(static_cast(address), static_cast(len), true); -} - -uint8_t TwoWire::requestFrom(int address, int len, int sendStop) -{ - return static_cast(requestFrom(static_cast(address), static_cast(len), static_cast(sendStop))); -} +// size_t TwoWire::requestFrom(uint8_t address, size_t len, bool sendStop) +// { +// return requestFrom(static_cast(address), static_cast(len), static_cast(sendStop)); +// } +// +// uint8_t TwoWire::requestFrom(uint8_t address, uint8_t len, uint8_t sendStop) +// { +// return requestFrom(static_cast(address), static_cast(len), static_cast(sendStop)); +// } +// +// uint8_t TwoWire::requestFrom(uint16_t address, uint8_t len, uint8_t sendStop) +// { +// return requestFrom(address, static_cast(len), static_cast(sendStop)); +// } +// +// /* 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 +// */ +// uint8_t TwoWire::requestFrom(uint16_t address, uint8_t len, bool stopBit) +// { +// return requestFrom((uint16_t)address, (size_t)len, stopBit); +// } +// +// uint8_t TwoWire::requestFrom(uint8_t address, uint8_t len) +// { +// return requestFrom(static_cast(address), static_cast(len), true); +// } +// +// uint8_t TwoWire::requestFrom(uint16_t address, uint8_t len) +// { +// return requestFrom(address, static_cast(len), true); +// } +// +// uint8_t TwoWire::requestFrom(int address, int len) +// { +// return requestFrom(static_cast(address), static_cast(len), true); +// } +// +// uint8_t TwoWire::requestFrom(int address, int len, int sendStop) +// { +// return static_cast(requestFrom(static_cast(address), static_cast(len), static_cast(sendStop))); +// } void TwoWire::beginTransmission(int address) { diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h index a4cdb117443..5af1e7ff939 100644 --- a/libraries/Wire/src/Wire.h +++ b/libraries/Wire/src/Wire.h @@ -100,11 +100,7 @@ class TwoWire: public Stream { return begin(addr, -1, -1, 0); } - inline bool begin(int addr) - { - return begin(static_cast(addr), -1, -1, 0); - } - bool end(); + bool end(); size_t setBufferSize(size_t bSize); @@ -121,15 +117,15 @@ class TwoWire: public Stream uint8_t endTransmission(bool sendStop); uint8_t endTransmission(void); - size_t requestFrom(uint16_t address, size_t size, bool sendStop); - uint8_t requestFrom(uint16_t address, uint8_t size, bool sendStop); - uint8_t requestFrom(uint16_t address, uint8_t size, uint8_t sendStop); - size_t requestFrom(uint8_t address, size_t len, bool stopBit); - 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); - uint8_t requestFrom(int address, int size, int sendStop); - uint8_t requestFrom(int address, int size); + size_t requestFrom(uint16_t address, size_t size, bool sendStop = true); + // uint8_t requestFrom(uint16_t address, uint8_t size, bool sendStop); + // uint8_t requestFrom(uint16_t address, uint8_t size, uint8_t sendStop); + // size_t requestFrom(uint8_t address, size_t len, bool stopBit); + // 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); + // uint8_t requestFrom(int address, int size, int sendStop); + // uint8_t requestFrom(int address, int size); size_t write(uint8_t); size_t write(const uint8_t *, size_t);