This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AIM 711 I2C fix - Checked by AntiVir DEMO version -


* src/aim711_misc.c: 
The I2C transfer routine waits now while the bus is busy
instead of just return an error.

I have seen the problem while initialisation of the 
wallclock driver. It has made sometime an error, only 
because the busy flag was set, which only means the bus is 
temporally busy.

Roland
Index: hal/arm/aim711/current/ChangeLog
===================================================================
RCS file: /home/cassebohm/net/USERS/CVSROOT/VSprojects/ecos/packages/hal/arm/aim711/current/ChangeLog,v
retrieving revision 1.1.2.5
diff -u -5 -p -r1.1.2.5 ChangeLog
--- hal/arm/aim711/current/ChangeLog	28 Apr 2004 15:19:14 -0000	1.1.2.5
+++ hal/arm/aim711/current/ChangeLog	7 Jun 2004 15:51:08 -0000
@@ -1,5 +1,11 @@
+2004-06-07  Roland Cassebohm <roland.cassebohm@visionsystems.de>
+
+        * 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 <roland.cassebohm@visionsystems.de>
 
 	* include/plf_aux.h:
 	* include/plf_io.h:
         Removed plf_aux.h, instead put the prototypes of the functions
Index: hal/arm/aim711/current/src/aim711_misc.c
===================================================================
RCS file: /home/cassebohm/net/USERS/CVSROOT/VSprojects/ecos/packages/hal/arm/aim711/current/src/aim711_misc.c,v
retrieving revision 1.1.2.10
diff -u -5 -p -r1.1.2.10 aim711_misc.c
--- hal/arm/aim711/current/src/aim711_misc.c	18 May 2004 09:09:34 -0000	1.1.2.10
+++ hal/arm/aim711/current/src/aim711_misc.c	7 Jun 2004 15:43:02 -0000
@@ -394,16 +394,14 @@ hal_ks32c_i2c_transfer(cyg_uint32 nmsg, 
     {
         RETURN(I2C_STATUS_MUTEX);
     }
 
     // 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)
     {
         // generate the start condition

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]