Skip to content
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

Merge to upsatream update #1

Merged
merged 6 commits into from
Oct 18, 2020
Next Next commit
Fixed return value bug in TwoWire::write
  • Loading branch information
mikljohansson committed Oct 10, 2020
commit 359f7a89f20aeae0d1c35836cb90ed5ced1bea68
5 changes: 3 additions & 2 deletions libraries/Wire/src/Wire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,16 +279,17 @@ TwoWire::requestFrom(uint16_t address, uint8_t size, bool sendStop) //请求数
size_t
TwoWire::write(uint8_t data) //写到txbuff
{
if(transmitting) {
if(transmitting && !i2c_tx_buff->isFull()) {
i2c_tx_buff->store_char(data);
return 1;
}
return 0;
}

size_t
TwoWire::write(const uint8_t *data, int quantity)
{
for(size_t i = 0; i < quantity; ++i) {
for(size_t i = 0; i < quantity; i++) {
if(!write(data[i])) {
return i;
}
Expand Down