arch/arm/src/samd2l2/sam_i2c_master.c: Correct time calculation.

This commit is contained in:
Bernd Walter 2019-08-26 08:08:56 -06:00 committed by Gregory Nutt
parent 65aabe3048
commit f9e80c4a1e

View File

@ -632,7 +632,7 @@ static int i2c_wait_for_bus(struct sam_i2c_dev_s *priv, unsigned int size)
clock_gettime(CLOCK_REALTIME, &ts);
usec = size * I2C_TIMEOUT_MSPB + ts.tv_nsec / 1000;
while (usec > USEC_PER_SEC)
while (usec >= USEC_PER_SEC)
{
ts.tv_sec += 1;
usec -= USEC_PER_SEC;