changeset 3227:3c3317a0eeb2

Add CYGBLD_I2C_DEVICE_CONST. This will allow driver to modify cyg_i2c_device streucture. [ Bugzilla 1001816 ]
author vae
date Fri, 26 Apr 2013 16:25:20 +0000
parents e10148c0a535
children c0f0661703ee
files packages/io/i2c/current/ChangeLog packages/io/i2c/current/include/i2c.h
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/packages/io/i2c/current/ChangeLog
+++ b/packages/io/i2c/current/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-10  Ilija Kocho <ilijak@siva.com.mk
+
+	* include/i2c.h: Add CYGBLD_I2C_DEVICE_CONST. This will allow driver
+	to modify cyg_i2c_device streucture. [ Bugzilla 1001816 ]
+
 2009-02-09  Bart Veer  <bartv@ecoscentric.com>
 
 	* cdl/i2c.cdl, src/i2c.cxx, doc/i2c.sgml: I2C buses now initialize
--- a/packages/io/i2c/current/include/i2c.h
+++ b/packages/io/i2c/current/include/i2c.h
@@ -82,6 +82,10 @@ typedef struct cyg_i2c_device {
 // The information needed for interacting over a particular I2C bus.
 // Most hardware will only have one bus, but multiple buses are
 // supported. Thread synchronization happens on a per-bus level.
+#ifndef CYGBLD_I2C_DEVICE_CONST
+#define CYGBLD_I2C_DEVICE_CONST const
+#endif
+
 typedef struct cyg_i2c_bus {
     cyg_drv_mutex_t         i2c_lock;
 #ifdef CYGDBG_USE_ASSERTS
@@ -89,8 +93,8 @@ typedef struct cyg_i2c_bus {
 #endif
     // The hardware-specific functions that do the real work
     void                    (*i2c_init_fn)(struct cyg_i2c_bus*);
-    cyg_uint32              (*i2c_tx_fn)(const cyg_i2c_device*, cyg_bool, const cyg_uint8*, cyg_uint32, cyg_bool);
-    cyg_uint32              (*i2c_rx_fn)(const cyg_i2c_device*, cyg_bool, cyg_uint8*, cyg_uint32, cyg_bool, cyg_bool);
+    cyg_uint32              (*i2c_tx_fn)(CYGBLD_I2C_DEVICE_CONST cyg_i2c_device*, cyg_bool, const cyg_uint8*, cyg_uint32, cyg_bool);
+    cyg_uint32              (*i2c_rx_fn)(CYGBLD_I2C_DEVICE_CONST cyg_i2c_device*, cyg_bool, cyg_uint8*, cyg_uint32, cyg_bool, cyg_bool);
     void                    (*i2c_stop_fn)(const cyg_i2c_device*);
     // A spare field for use by the driver
     void*                   i2c_extra;