Currently, brzo i2c uses a uint16_t datatype for holding the number of iterations iteration_scl_clock_stretch for the timeout of SCL clock stretching. The maximum timeout is therefore around 5 msec (milli seconds).
There are i2c slaves, like for instance the HTU21, which stretch the clock up to 50 msec (milli seconds) or even more!
Thus, iteration_scl_clock_stretch should be of datatype uint32_t instead.
Currently, brzo i2c uses a
uint16_t
datatype for holding the number of iterationsiteration_scl_clock_stretch
for the timeout of SCL clock stretching. The maximum timeout is therefore around 5 msec (milli seconds).There are i2c slaves, like for instance the HTU21, which stretch the clock up to 50 msec (milli seconds) or even more!
Thus,
iteration_scl_clock_stretch
should be of datatypeuint32_t
instead.