Skip to content

Commit

Permalink
Merge pull request #126 from bmourit/patch-3
Browse files Browse the repository at this point in the history
Fix 2 "statement has no effect" warnings
  • Loading branch information
maxgerhardt authored May 19, 2024
2 parents c9e2b2f + 52c9839 commit 858a0d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libraries/Wire/src/utility/twi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ void i2c_attach_slave_rx_callback(i2c_t *obj, void (*function)(void*, uint8_t*,
return;
}
obj->slave_receive_callback = function;
obj->pWireObj;
obj->pWireObj= pWireObj;
}

/** sets function called before a slave write operation
Expand Down Expand Up @@ -546,8 +546,7 @@ i2c_status_enum i2c_slave_write_buffer(i2c_t *obj, uint8_t *data, uint16_t lengt
if ( (obj_s->tx_count + length) > obj->tx_rx_buffer_size)
return I2C_DATA_TOO_LONG;

uint8_t i = 0;
for (i; i < length; i++)
for (uint8_t i = 0; i < length; i++)
*obj_s->tx_buffer_ptr++ = *(data + i);
obj_s->tx_count += length;
return I2C_OK;
Expand Down

0 comments on commit 858a0d5

Please sign in to comment.