
9 Sep
2009
9 Sep
'09
11:19 a.m.
I wonder if this hides another problem too. if the timeout hits, -1 is returned.
Then in i2c_read()/i2c_write() you have: if (i2c_wait4bus() >= 0 && i2c_write_addr(dev, I2C_WRITE_BIT, 0) != 0 && __i2c_write(&a[4 - alen], alen) == alen) i = 0; /* No error so far */ notice how the latter part, i2c_write_addr(dev, I2C_WRITE_BIT, 0) != 0 && __i2c_write(&a[4 - alen], alen) == alen) is ignored(never called) when i2c_wait4bus() returns -1
Jocke