[U-Boot] Odd value for I2C_TIMEOUT in fsl_i2c.c

Wolfgang Denk wd at denx.de
Fri Sep 4 10:31:00 CEST 2009


Dear Timur Tabi,

In message <4A9FDF1E.4090908 at freescale.com> you wrote:
> Currently we define I2C_TIMEOUT like this:
> 
> #define I2C_TIMEOUT	(CONFIG_SYS_HZ / 4)

= 250, that is.

> CONFIG_HZ is 1000, so I2C_TIMEOUT is equal to 250.  However, the way it's used, 250 isn't the number of ticks per second, it's used as number of microseconds.  If CONFIG_HZ is changed to 100, does that mean that we want to call usec2ticks(25)?

CONFIG_SYS_HZ is a constant of 1000. We do not change constants.

> Surely, one millisecond is not too long of a timeout?

It definitely depends which sort of timeout this is.

I guess there is some specification?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Don't put off for tomorrow what you can  do  today,  because  if  you
enjoy it today you can do it again tomorrow.


More information about the U-Boot mailing list