Skip to content

Fix requestFrom() return type for 16-bit lengths #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions libraries/Wire/Wire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void TwoWire::end() {
sercom->disableWIRE();
}

uint8_t TwoWire::requestFrom(uint8_t address, size_t quantity, bool stopBit)
size_t TwoWire::requestFrom(uint8_t address, size_t quantity, bool stopBit)
{
if(quantity == 0)
{
Expand Down Expand Up @@ -105,7 +105,7 @@ uint8_t TwoWire::requestFrom(uint8_t address, size_t quantity, bool stopBit)
return byteRead;
}

uint8_t TwoWire::requestFrom(uint8_t address, size_t quantity)
size_t TwoWire::requestFrom(uint8_t address, size_t quantity)
{
return requestFrom(address, quantity, true);
}
Expand Down Expand Up @@ -336,4 +336,3 @@ void TwoWire::onService(void)
Wire5.onService();
}
#endif

4 changes: 2 additions & 2 deletions libraries/Wire/Wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class TwoWire : public HardwareI2C
uint8_t endTransmission(bool stopBit);
uint8_t endTransmission(void);

uint8_t requestFrom(uint8_t address, size_t quantity, bool stopBit);
uint8_t requestFrom(uint8_t address, size_t quantity);
size_t requestFrom(uint8_t address, size_t quantity, bool stopBit);
size_t requestFrom(uint8_t address, size_t quantity);

size_t write(uint8_t data);
size_t write(const uint8_t * data, size_t quantity);
Expand Down