# HG changeset patch # User asl # Date 1086717151 0 # Node ID ac397049b1b7894040cf2dafd783636abf0eb258 # Parent 96994236ec0759c4855aa37d66ebb85938d114e3 The I2C transfer routine waits now while the bus is busy instead of just return an error. diff --git a/packages/hal/arm/aim711/current/ChangeLog b/packages/hal/arm/aim711/current/ChangeLog --- a/packages/hal/arm/aim711/current/ChangeLog +++ b/packages/hal/arm/aim711/current/ChangeLog @@ -1,3 +1,9 @@ +2004-06-07 Roland Cassebohm + + * src/aim711_misc.c: + The I2C transfer routine waits now while the bus is busy + instead of just return an error. + 2004-04-28 Roland Cassebohm * include/plf_aux.h: diff --git a/packages/hal/arm/aim711/current/src/aim711_misc.c b/packages/hal/arm/aim711/current/src/aim711_misc.c --- a/packages/hal/arm/aim711/current/src/aim711_misc.c +++ b/packages/hal/arm/aim711/current/src/aim711_misc.c @@ -396,12 +396,10 @@ hal_ks32c_i2c_transfer(cyg_uint32 nmsg, } // is the bus free ? - HAL_READ_UINT32(KS32C_I2CCON, i2ccon); - if (i2ccon & KS32C_I2C_CON_BUSY) + do { - cyg_drv_mutex_unlock(&i2c_mutex); - RETURN(I2C_STATUS_BUSY); - } + HAL_READ_UINT32(KS32C_I2CCON, i2ccon); + } while (i2ccon & KS32C_I2C_CON_BUSY); // transfer the messages for (; nmsg > 0; --nmsg, ++pmsgs)