Skip to content

Commit

Permalink
added wait for ACK after a I2C transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
boramonideep committed Aug 8, 2023
1 parent 70b950a commit 31e2ea8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/Wire/src/Wire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint32_t iaddres
XMC_I2C_CH_MasterStart(XMC_I2C_config->channel, (txAddress << 1), XMC_I2C_CH_CMD_READ);
}

while((XMC_I2C_CH_GetStatusFlag(XMC_I2C_config->channel) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 0U);

for (uint8_t count = 0; count < (quantity - 1); count ++)
{
XMC_I2C_CH_MasterReceiveAck(XMC_I2C_config->channel);
Expand Down

0 comments on commit 31e2ea8

Please sign in to comment.